Example usage for io.vertx.core.http HttpClientOptions setKeepAlive

List of usage examples for io.vertx.core.http HttpClientOptions setKeepAlive

Introduction

In this page you can find the example usage for io.vertx.core.http HttpClientOptions setKeepAlive.

Prototype

public HttpClientOptions setKeepAlive(boolean keepAlive) 

Source Link

Document

Set whether keep alive is enabled on the client

Usage

From source file:org.apache.servicecomb.transport.rest.client.RestTransportClient.java

License:Apache License

private static HttpClientOptions createHttpClientOptions() {
    HttpClientOptions httpClientOptions = new HttpClientOptions();
    httpClientOptions.setMaxPoolSize(TransportClientConfig.getConnectionMaxPoolSize());
    httpClientOptions.setIdleTimeout(TransportClientConfig.getConnectionIdleTimeoutInSeconds());
    httpClientOptions.setKeepAlive(TransportClientConfig.getConnectionKeepAlive());
    httpClientOptions.setTryUseCompression(TransportClientConfig.getConnectionCompression());

    VertxTLSBuilder.buildHttpClientOptions(SSL_KEY, httpClientOptions);
    return httpClientOptions;
}

From source file:org.etourdot.vertx.marklogic.http.impl.DefaultRestService.java

License:Open Source License

private DefaultRestService(Builder builder) {
    realm = new Realm(builder.authentication, builder.user, builder.password);
    HttpClientOptions httpClientOptions = new HttpClientOptions();
    httpClientOptions.setDefaultHost(builder.host);
    httpClientOptions.setDefaultPort(builder.port);
    httpClientOptions.setKeepAlive(builder.keepAlive);
    this.httpClient = builder.vertx.createHttpClient(httpClientOptions);
}