U - the type of address before resolution (unresolved address)R - the type of address after resolution (resolved address)public class DelegatingPartitionedHttpClientBuilder<U,R> extends Object implements PartitionedHttpClientBuilder<U,R>
PartitionedHttpClientBuilder that delegates all methods to another PartitionedHttpClientBuilder.PartitionedHttpClientBuilder.SingleAddressInitializer<U,R>| Constructor and Description |
|---|
DelegatingPartitionedHttpClientBuilder(PartitionedHttpClientBuilder<U,R> delegate)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
PartitionedHttpClientBuilder<U,R> |
bufferAllocator(BufferAllocator allocator)
Sets the
BufferAllocator for all clients created from this builder. |
HttpClient |
build()
Builds a new
HttpClient. |
BlockingHttpClient |
buildBlocking()
Creates a new
BlockingHttpClient. |
BlockingStreamingHttpClient |
buildBlockingStreaming()
Creates a new
BlockingStreamingHttpClient. |
StreamingHttpClient |
buildStreaming()
Builds a new
StreamingHttpClient. |
protected PartitionedHttpClientBuilder<U,R> |
delegate()
Returns the
PartitionedHttpClientBuilder delegate. |
PartitionedHttpClientBuilder<U,R> |
executionStrategy(HttpExecutionStrategy strategy)
Sets the
HttpExecutionStrategy to be used for client callbacks when executing client requests for all
clients created from this builder. |
PartitionedHttpClientBuilder<U,R> |
executor(Executor executor)
Sets the
Executor for all clients created from this builder. |
PartitionedHttpClientBuilder<U,R> |
headersFactory(HttpHeadersFactory headersFactory)
Sets the
HttpHeadersFactory to be used for creating HttpHeaders for new requests. |
PartitionedHttpClientBuilder<U,R> |
initializer(PartitionedHttpClientBuilder.SingleAddressInitializer<U,R> initializer)
Set a function which can customize options for each
StreamingHttpClient that is built. |
PartitionedHttpClientBuilder<U,R> |
ioExecutor(IoExecutor ioExecutor)
Sets the
IoExecutor for all clients created from this builder. |
PartitionedHttpClientBuilder<U,R> |
partitionMapFactory(PartitionMapFactory partitionMapFactory)
Sets
PartitionMapFactory to use by all StreamingHttpClients created by this builder. |
PartitionedHttpClientBuilder<U,R> |
retryServiceDiscoveryErrors(BiIntFunction<Throwable,? extends Completable> retryStrategy)
Sets a retry strategy to retry errors emitted by
ServiceDiscoverer. |
PartitionedHttpClientBuilder<U,R> |
serviceDiscoverer(ServiceDiscoverer<U,R,PartitionedServiceDiscovererEvent<R>> serviceDiscoverer)
Sets a
ServiceDiscoverer to resolve addresses of remote servers to connect to. |
PartitionedHttpClientBuilder<U,R> |
serviceDiscoveryMaxQueueSize(int serviceDiscoveryMaxQueueSize)
Sets the maximum amount of
ServiceDiscovererEvent objects that will be queued for each partition. |
String |
toString() |
public DelegatingPartitionedHttpClientBuilder(PartitionedHttpClientBuilder<U,R> delegate)
delegate - PartitionedHttpClientBuilder to which all methods are delegated.protected final PartitionedHttpClientBuilder<U,R> delegate()
PartitionedHttpClientBuilder delegate.PartitionedHttpClientBuilder.public String toString()
toString in class Objectpublic PartitionedHttpClientBuilder<U,R> ioExecutor(IoExecutor ioExecutor)
IoExecutor for all clients created from this builder.ioExecutor in interface PartitionedHttpClientBuilder<U,R>ioExecutor - IoExecutor to use.this.public PartitionedHttpClientBuilder<U,R> executor(Executor executor)
Executor for all clients created from this builder.executor in interface PartitionedHttpClientBuilder<U,R>executor - IoExecutor to use.this.public PartitionedHttpClientBuilder<U,R> executionStrategy(HttpExecutionStrategy strategy)
HttpExecutionStrategy to be used for client callbacks when executing client requests for all
clients created from this builder.executionStrategy in interface PartitionedHttpClientBuilder<U,R>strategy - HttpExecutionStrategy to use. If callbacks to the application code may block then those
callbacks must request to be offloaded.this.HttpExecutionStrategiespublic PartitionedHttpClientBuilder<U,R> bufferAllocator(BufferAllocator allocator)
BufferAllocator for all clients created from this builder.bufferAllocator in interface PartitionedHttpClientBuilder<U,R>allocator - BufferAllocator to use.this.public PartitionedHttpClientBuilder<U,R> headersFactory(HttpHeadersFactory headersFactory)
PartitionedHttpClientBuilderHttpHeadersFactory to be used for creating HttpHeaders for new requests.headersFactory in interface PartitionedHttpClientBuilder<U,R>headersFactory - HttpHeadersFactory to be used for creating HttpHeaders for new requeststhispublic PartitionedHttpClientBuilder<U,R> serviceDiscoverer(ServiceDiscoverer<U,R,PartitionedServiceDiscovererEvent<R>> serviceDiscoverer)
PartitionedHttpClientBuilderServiceDiscoverer to resolve addresses of remote servers to connect to.serviceDiscoverer in interface PartitionedHttpClientBuilder<U,R>serviceDiscoverer - The ServiceDiscoverer to resolve addresses of remote servers to connect to.
Lifecycle of the provided ServiceDiscoverer is managed externally and it should be
closed after all built StreamingHttpClients will be closed and
this ServiceDiscoverer is no longer needed.this.public PartitionedHttpClientBuilder<U,R> retryServiceDiscoveryErrors(BiIntFunction<Throwable,? extends Completable> retryStrategy)
PartitionedHttpClientBuilderServiceDiscoverer.retryServiceDiscoveryErrors in interface PartitionedHttpClientBuilder<U,R>retryStrategy - a retry strategy to retry errors emitted by ServiceDiscoverer.this.RetryStrategiespublic PartitionedHttpClientBuilder<U,R> serviceDiscoveryMaxQueueSize(int serviceDiscoveryMaxQueueSize)
PartitionedHttpClientBuilderServiceDiscovererEvent objects that will be queued for each partition.
It is assumed that the PublisherSource.Subscribers will process events in a timely manner (typically synchronously)
so this typically doesn't need to be very large.
serviceDiscoveryMaxQueueSize in interface PartitionedHttpClientBuilder<U,R>serviceDiscoveryMaxQueueSize - the maximum amount of ServiceDiscovererEvent objects that will be
queued for each partition.this.public PartitionedHttpClientBuilder<U,R> partitionMapFactory(PartitionMapFactory partitionMapFactory)
PartitionedHttpClientBuilderPartitionMapFactory to use by all StreamingHttpClients created by this builder.partitionMapFactory in interface PartitionedHttpClientBuilder<U,R>partitionMapFactory - PartitionMapFactory to use.this.public PartitionedHttpClientBuilder<U,R> initializer(PartitionedHttpClientBuilder.SingleAddressInitializer<U,R> initializer)
PartitionedHttpClientBuilderStreamingHttpClient that is built.initializer in interface PartitionedHttpClientBuilder<U,R>initializer - Initializes the SingleAddressHttpClientBuilder used to build new
StreamingHttpClients.thispublic HttpClient build()
HttpClient.HttpClientpublic StreamingHttpClient buildStreaming()
StreamingHttpClient.StreamingHttpClientpublic BlockingHttpClient buildBlocking()
BlockingHttpClient.BlockingHttpClientpublic BlockingStreamingHttpClient buildBlockingStreaming()
BlockingStreamingHttpClient.BlockingStreamingHttpClient