Search in sources :

Example 11 with ExecutionListener

use of com.netflix.loadbalancer.reactive.ExecutionListener in project wildfly-swarm by wildfly-swarm.

the class SecuredTransportFactory method newHttpClient.

@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;
}
Also used : HttpClientRequest(io.reactivex.netty.protocol.http.client.HttpClientRequest) PipelineConfiguratorComposite(io.reactivex.netty.pipeline.PipelineConfiguratorComposite) HttpClientResponse(io.reactivex.netty.protocol.http.client.HttpClientResponse) ArrayList(java.util.ArrayList) HttpObjectAggregationConfigurator(io.reactivex.netty.protocol.http.HttpObjectAggregationConfigurator) ByteBuf(io.netty.buffer.ByteBuf) ExecutionListener(com.netflix.loadbalancer.reactive.ExecutionListener)

Aggregations

ExecutionListener (com.netflix.loadbalancer.reactive.ExecutionListener)11 Server (com.netflix.loadbalancer.Server)9 ByteBuf (io.netty.buffer.ByteBuf)8 Test (org.junit.Test)8 MockWebServer (com.google.mockwebserver.MockWebServer)7 IClientConfig (com.netflix.client.config.IClientConfig)7 AvailabilityFilteringRule (com.netflix.loadbalancer.AvailabilityFilteringRule)7 BaseLoadBalancer (com.netflix.loadbalancer.BaseLoadBalancer)7 DummyPing (com.netflix.loadbalancer.DummyPing)7 AbortExecutionException (com.netflix.loadbalancer.reactive.ExecutionListener.AbortExecutionException)5 ExecutionContext (com.netflix.loadbalancer.reactive.ExecutionContext)4 ArrayList (java.util.ArrayList)4 ClientException (com.netflix.client.ClientException)3 ExecutionInfo (com.netflix.loadbalancer.reactive.ExecutionInfo)3 HttpClientResponse (io.reactivex.netty.protocol.http.client.HttpClientResponse)3 IOException (java.io.IOException)3 MockResponse (com.google.mockwebserver.MockResponse)2 IRule (com.netflix.loadbalancer.IRule)2 LoadBalancerCommand (com.netflix.loadbalancer.reactive.LoadBalancerCommand)2 ServerOperation (com.netflix.loadbalancer.reactive.ServerOperation)2