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 PartitionedServiceDiscovererEvents 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 interfaceDeprecated.Initializes theSingleAddressHttpClientBuilderfor each new client. -
Method Summary
Modifier and TypeMethodDescriptionbufferAllocator(BufferAllocator allocator) Deprecated.default HttpClientbuild()Builds a newHttpClient.default BlockingHttpClientCreates a newBlockingHttpClient.default BlockingStreamingHttpClientCreates a newBlockingStreamingHttpClient.Builds a newStreamingHttpClient.executionStrategy(HttpExecutionStrategy strategy) Deprecated.Deprecated.default PartitionedHttpClientBuilder<U,R> headersFactory(HttpHeadersFactory headersFactory) Deprecated.Sets theHttpHeadersFactoryto be used for creatingHttpHeadersfor new requests.initializer(PartitionedHttpClientBuilder.SingleAddressInitializer<U, R> initializer) Deprecated.Set a function which can customize options for eachStreamingHttpClientthat is built.ioExecutor(IoExecutor ioExecutor) Deprecated.partitionMapFactory(PartitionMapFactory partitionMapFactory) Deprecated.SetsPartitionMapFactoryto use by allStreamingHttpClients 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 aServiceDiscovererto resolve addresses of remote servers to connect to.serviceDiscoveryMaxQueueSize(int serviceDiscoveryMaxQueueSize) Deprecated.Sets the maximum amount ofServiceDiscovererEventobjects that will be queued for each partition.
-
Method Details
-
ioExecutor
Deprecated. -
executor
Deprecated. -
executionStrategy
Deprecated. -
bufferAllocator
Deprecated. -
headersFactory
Deprecated.Sets theHttpHeadersFactoryto be used for creatingHttpHeadersfor new requests.- Parameters:
headersFactory-HttpHeadersFactoryto be used for creatingHttpHeadersfor new requests- Returns:
this
-
serviceDiscoverer
PartitionedHttpClientBuilder<U,R> serviceDiscoverer(ServiceDiscoverer<U, R, PartitionedServiceDiscovererEvent<R>> serviceDiscoverer) Deprecated.Sets aServiceDiscovererto resolve addresses of remote servers to connect to.- Parameters:
serviceDiscoverer- TheServiceDiscovererto resolve addresses of remote servers to connect to. Lifecycle of the providedServiceDiscovereris managed externally and it should beclosedafter all builtStreamingHttpClients will be closed and thisServiceDiscovereris 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 ofServiceDiscovererEventobjects 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.- Parameters:
serviceDiscoveryMaxQueueSize- the maximum amount ofServiceDiscovererEventobjects that will be queued for each partition.- Returns:
this.
-
partitionMapFactory
Deprecated.SetsPartitionMapFactoryto use by allStreamingHttpClients created by this builder.- Parameters:
partitionMapFactory-PartitionMapFactoryto use.- Returns:
this.
-
initializer
PartitionedHttpClientBuilder<U,R> initializer(PartitionedHttpClientBuilder.SingleAddressInitializer<U, R> initializer) Deprecated.Set a function which can customize options for eachStreamingHttpClientthat is built.- Parameters:
initializer- Initializes theSingleAddressHttpClientBuilderused to build newStreamingHttpClients.- 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
-
ClientGroupas an alternative or reach out to the maintainers describing the use-case.