io.reactivex.netty.protocol.http.client.HttpClientPipelineConfigurator Java Examples
The following examples show how to use
io.reactivex.netty.protocol.http.client.HttpClientPipelineConfigurator.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SecuredTransportFactory.java From thorntail with Apache License 2.0 | 6 votes |
@Override public HttpClient<ByteBuf, ByteBuf> newHttpClient(final IClientConfig config) { final List<ExecutionListener<HttpClientRequest<ByteBuf>, HttpClientResponse<ByteBuf>>> listeners = new ArrayList<>(); listeners.add(createBearerHeaderAdder()); final PipelineConfiguratorComposite<HttpClientResponse<ByteBuf>, HttpClientRequest<ByteBuf>> pipelineConfigurator = new PipelineConfiguratorComposite<HttpClientResponse<ByteBuf>, HttpClientRequest<ByteBuf>>(new HttpClientPipelineConfigurator<ByteBuf, ByteBuf>(), new HttpObjectAggregationConfigurator(maxChunkSize)); final LoadBalancingHttpClient<ByteBuf, ByteBuf> client = LoadBalancingHttpClient.<ByteBuf, ByteBuf>builder() .withClientConfig(config) .withExecutorListeners(listeners) .withRetryHandler(getDefaultHttpRetryHandlerWithConfig(config)) .withPipelineConfigurator(pipelineConfigurator) .withPoolCleanerScheduler(RibbonTransport.poolCleanerScheduler) .build(); return client; }
Example #2
Source File: SecuredTransportFactory.java From ARCHIVE-wildfly-swarm with Apache License 2.0 | 6 votes |
@Override public HttpClient<ByteBuf, ByteBuf> newHttpClient(final IClientConfig config) { final List<ExecutionListener<HttpClientRequest<ByteBuf>, HttpClientResponse<ByteBuf>>> listeners = new ArrayList<>(); listeners.add(createBearerHeaderAdder()); final PipelineConfiguratorComposite<HttpClientResponse<ByteBuf>, HttpClientRequest<ByteBuf>> pipelineConfigurator = new PipelineConfiguratorComposite<HttpClientResponse<ByteBuf>, HttpClientRequest<ByteBuf>>(new HttpClientPipelineConfigurator<ByteBuf, ByteBuf>(), new HttpObjectAggregationConfigurator(maxChunkSize)); final LoadBalancingHttpClient<ByteBuf, ByteBuf> client = LoadBalancingHttpClient.<ByteBuf, ByteBuf>builder() .withClientConfig(config) .withExecutorListeners(listeners) .withRetryHandler(getDefaultHttpRetryHandlerWithConfig(config)) .withPipelineConfigurator(pipelineConfigurator) .withPoolCleanerScheduler(RibbonTransport.poolCleanerScheduler) .build(); return client; }
Example #3
Source File: ProxyHandler.java From Prana with Apache License 2.0 | 6 votes |
private LoadBalancingHttpClient<ByteBuf, ByteBuf> getClient(String vip) { LoadBalancingHttpClient<ByteBuf, ByteBuf> client = httpClients.get(vip); if (client == null) { IClientConfig config = IClientConfig.Builder.newBuilder("prana_backend"). withDefaultValues(). withDeploymentContextBasedVipAddresses(vip). build(). set(IClientConfigKey.Keys.MaxTotalConnections, 2000). set(IClientConfigKey.Keys.MaxConnectionsPerHost, 2000). set(IClientConfigKey.Keys.OkToRetryOnAllOperations, false). set(IClientConfigKey.Keys.NIWSServerListClassName, DiscoveryEnabledNIWSServerList.class.getName()); client = RibbonTransport.newHttpClient(new HttpClientPipelineConfigurator<ByteBuf, ByteBuf>(), config); httpClients.putIfAbsent(vip, client); } return client; }
Example #4
Source File: HttpClientFactory.java From azure-cosmosdb-java with MIT License | 5 votes |
private static PipelineConfigurator createClientPipelineConfigurator(Configs config) { PipelineConfigurator clientPipelineConfigurator = new PipelineConfiguratorComposite( new HttpClientPipelineConfigurator<ByteBuf, ByteBuf>( config.getMaxHttpInitialLineLength(), config.getMaxHttpHeaderSize(), config.getMaxHttpChunkSize(), true), new HttpObjectAggregationConfigurator(config.getMaxHttpBodyLength())); return clientPipelineConfigurator; }