private Observable < HttpClientResponse < O > > submit ( final Server server , final HttpClientRequest < I > request , final RetryHandler errorHandler , final IClientConfig requestConfig , final ClientConfig rxClientConfig ) { RetryHandler retryHandler = errorHandler ; if ( retryHandler == null ) { retryHandler = getRequestRetryHandler ( request , requestConfig ) ; } final IClientConfig config = requestConfig == null ? DefaultClientConfigImpl . getEmptyConfig ( ) : requestConfig ; final ExecutionContext < HttpClientRequest < I > > context = new ExecutionContext < HttpClientRequest < I > > ( request , config , this . getClientConfig ( ) , retryHandler ) ; Observable < HttpClientResponse < O > > result = submitToServerInURI ( request , config , rxClientConfig , retryHandler , context ) ; if ( result == null ) { LoadBalancerCommand < HttpClientResponse < O >> command ; if ( retryHandler != defaultRetryHandler ) { // need to create new builder instead of the default one command = LoadBalancerCommand . < HttpClientResponse < O > > builder ( ) . withExecutionContext ( context ) . withLoadBalancerContext ( lbContext ) . withListeners ( listeners ) . withClientConfig ( this . getClientConfig ( ) ) . withRetryHandler ( retryHandler ) . withServer ( server ) . build ( ) ; } else { command = defaultCommandBuilder ; } result = command . submit ( requestToOperation ( request , getRxClientConfig ( config , rxClientConfig ) ) ) ; } return result ; }
Subject an operation to run in the load balancer