Package io.servicetalk.http.api
Interface PartitionedHttpClientBuilder<U,R>
- Type Parameters:
U
- the type of address before resolution (unresolved address)R
- the type of address after resolution (resolved address)
- All Known Implementing Classes:
DelegatingPartitionedHttpClientBuilder
Deprecated.
A builder of homogeneous
StreamingHttpClient
instances which call the server associated with a partition
selected from a set of PartitionedServiceDiscovererEvent
s resolved from a single unresolved address.
Partition selection uses a function to infer PartitionAttributes
from the HttpRequestMetaData
.
It also provides a good set of default settings and configurations, which could be used by most users as-is or
could be overridden to address specific use cases.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Deprecated.Initializes theSingleAddressHttpClientBuilder
for each new client. -
Method Summary
Modifier and TypeMethodDescriptionbufferAllocator
(BufferAllocator allocator) Deprecated.default HttpClient
build()
Builds a newHttpClient
.default BlockingHttpClient
Creates a newBlockingHttpClient
.default BlockingStreamingHttpClient
Creates a newBlockingStreamingHttpClient
.Builds a newStreamingHttpClient
.executionStrategy
(HttpExecutionStrategy strategy) Deprecated.Deprecated.default PartitionedHttpClientBuilder<U,
R> headersFactory
(HttpHeadersFactory headersFactory) Deprecated.Sets theHttpHeadersFactory
to be used for creatingHttpHeaders
for new requests.initializer
(PartitionedHttpClientBuilder.SingleAddressInitializer<U, R> initializer) Deprecated.Set a function which can customize options for eachStreamingHttpClient
that is built.ioExecutor
(IoExecutor ioExecutor) Deprecated.partitionMapFactory
(PartitionMapFactory partitionMapFactory) Deprecated.SetsPartitionMapFactory
to use by allStreamingHttpClient
s created by this builder.retryServiceDiscoveryErrors
(BiIntFunction<Throwable, ? extends Completable> retryStrategy) Deprecated.Sets a retry strategy to retry errors emitted byServiceDiscoverer
.serviceDiscoverer
(ServiceDiscoverer<U, R, PartitionedServiceDiscovererEvent<R>> serviceDiscoverer) Deprecated.Sets aServiceDiscoverer
to resolve addresses of remote servers to connect to.serviceDiscoveryMaxQueueSize
(int serviceDiscoveryMaxQueueSize) Deprecated.Sets the maximum amount ofServiceDiscovererEvent
objects that will be queued for each partition.
-
Method Details
-
ioExecutor
Deprecated. -
executor
Deprecated. -
executionStrategy
Deprecated. -
bufferAllocator
Deprecated. -
headersFactory
Deprecated.Sets theHttpHeadersFactory
to be used for creatingHttpHeaders
for new requests.- Parameters:
headersFactory
-HttpHeadersFactory
to be used for creatingHttpHeaders
for new requests- Returns:
this
-
serviceDiscoverer
PartitionedHttpClientBuilder<U,R> serviceDiscoverer(ServiceDiscoverer<U, R, PartitionedServiceDiscovererEvent<R>> serviceDiscoverer) Deprecated.Sets aServiceDiscoverer
to resolve addresses of remote servers to connect to.- Parameters:
serviceDiscoverer
- TheServiceDiscoverer
to resolve addresses of remote servers to connect to. Lifecycle of the providedServiceDiscoverer
is managed externally and it should beclosed
after all builtStreamingHttpClient
s will be closed and thisServiceDiscoverer
is no longer needed.- Returns:
this
.
-
retryServiceDiscoveryErrors
PartitionedHttpClientBuilder<U,R> retryServiceDiscoveryErrors(BiIntFunction<Throwable, ? extends Completable> retryStrategy) Deprecated.Sets a retry strategy to retry errors emitted byServiceDiscoverer
.- Parameters:
retryStrategy
- a retry strategy to retry errors emitted byServiceDiscoverer
.- Returns:
this
.- See Also:
-
serviceDiscoveryMaxQueueSize
Deprecated.Sets the maximum amount ofServiceDiscovererEvent
objects that will be queued for each partition.It is assumed that the
PublisherSource.Subscriber
s will process events in a timely manner (typically synchronously) so this typically doesn't need to be very large.- Parameters:
serviceDiscoveryMaxQueueSize
- the maximum amount ofServiceDiscovererEvent
objects that will be queued for each partition.- Returns:
this
.
-
partitionMapFactory
Deprecated.SetsPartitionMapFactory
to use by allStreamingHttpClient
s created by this builder.- Parameters:
partitionMapFactory
-PartitionMapFactory
to use.- Returns:
this
.
-
initializer
PartitionedHttpClientBuilder<U,R> initializer(PartitionedHttpClientBuilder.SingleAddressInitializer<U, R> initializer) Deprecated.Set a function which can customize options for eachStreamingHttpClient
that is built.- Parameters:
initializer
- Initializes theSingleAddressHttpClientBuilder
used to build newStreamingHttpClient
s.- Returns:
this
-
buildStreaming
StreamingHttpClient buildStreaming()Builds a newStreamingHttpClient
.- Returns:
- A new
StreamingHttpClient
- Throws:
IllegalArgumentException
- for incomplete or illegal configurationsIllegalStateException
- for unsupported configuration combinations
-
build
Builds a newHttpClient
.- Returns:
- A new
HttpClient
-
buildBlockingStreaming
Creates a newBlockingStreamingHttpClient
.- Returns:
BlockingStreamingHttpClient
-
buildBlocking
Creates a newBlockingHttpClient
.- Returns:
BlockingHttpClient
-
ClientGroup
as an alternative or reach out to the maintainers describing the use-case.