public final class TimeoutHttpRequesterFilter
extends Object
implements StreamingHttpClientFilterFactory, StreamingHttpConnectionFilterFactory
The timeout applies either the response metadata (headers) completion or the complete reception of the response payload body and optional trailers.
The order with which this filter is applied may be highly significant. For example, appending it before a retry filter would have different results than applying it after the retry filter; timeout would apply for all retries vs timeout per retry.
| Constructor and Description |
|---|
TimeoutHttpRequesterFilter(BiFunction<HttpRequestMetaData,TimeSource,Duration> timeoutForRequest,
boolean fullRequestResponse)
Creates a new instance.
|
TimeoutHttpRequesterFilter(BiFunction<HttpRequestMetaData,TimeSource,Duration> timeoutForRequest,
boolean fullRequestResponse,
Executor timeoutExecutor)
Creates a new instance.
|
TimeoutHttpRequesterFilter(Duration duration)
Creates a new instance which requires only that the response metadata be received before the timeout.
|
TimeoutHttpRequesterFilter(Duration duration,
boolean fullRequestResponse)
Creates a new instance.
|
TimeoutHttpRequesterFilter(Duration duration,
boolean fullRequestResponse,
Executor timeoutExecutor)
Creates a new instance.
|
TimeoutHttpRequesterFilter(Duration duration,
Executor timeoutExecutor)
Creates a new instance which requires only that the response metadata be received before the timeout.
|
TimeoutHttpRequesterFilter(TimeoutFromRequest timeoutForRequest,
boolean fullRequestResponse)
Deprecated.
|
TimeoutHttpRequesterFilter(TimeoutFromRequest timeoutForRequest,
boolean fullRequestResponse,
Executor timeoutExecutor)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
StreamingHttpClientFilter |
create(FilterableStreamingHttpClient client) |
StreamingHttpConnectionFilter |
create(FilterableStreamingHttpConnection connection) |
HttpExecutionStrategy |
requiredOffloads() |
public TimeoutHttpRequesterFilter(Duration duration)
duration - the timeout Durationpublic TimeoutHttpRequesterFilter(Duration duration,
Executor timeoutExecutor)
duration - the timeout DurationtimeoutExecutor - the Executor to use for managing the timer notificationspublic TimeoutHttpRequesterFilter(Duration duration,
boolean fullRequestResponse)
duration - the timeout DurationfullRequestResponse - if true then timeout is for full request/response transaction otherwise only
the response metadata must arrive before the timeoutpublic TimeoutHttpRequesterFilter(Duration duration,
boolean fullRequestResponse,
Executor timeoutExecutor)
duration - the timeout DurationfullRequestResponse - if true then timeout is for full request/response transaction otherwise only
the response metadata must arrive before the timeouttimeoutExecutor - the Executor to use for managing the timer notifications@Deprecated public TimeoutHttpRequesterFilter(TimeoutFromRequest timeoutForRequest, boolean fullRequestResponse)
TimeoutHttpRequesterFilter(BiFunction, boolean).timeoutForRequest - function for extracting timeout from request which may also determine the timeout using
other sources. If no timeout is to be applied then the function should return nullfullRequestResponse - if true then timeout is for full request/response transaction otherwise only
the response metadata must arrive before the timeoutpublic TimeoutHttpRequesterFilter(BiFunction<HttpRequestMetaData,TimeSource,Duration> timeoutForRequest,
boolean fullRequestResponse)
timeoutForRequest - function for extracting timeout from request which may also determine the timeout using
other sources. If no timeout is to be applied then the function should return nullfullRequestResponse - if true then timeout is for full request/response transaction otherwise only
the response metadata must arrive before the timeout@Deprecated public TimeoutHttpRequesterFilter(TimeoutFromRequest timeoutForRequest, boolean fullRequestResponse, Executor timeoutExecutor)
TimeoutHttpRequesterFilter(BiFunction, boolean, Executor).timeoutForRequest - function for extracting timeout from request which may also determine the timeout using
other sources. If no timeout is to be applied then the function should return nullfullRequestResponse - if true then timeout is for full request/response transaction otherwise only
the response metadata must arrive before the timeouttimeoutExecutor - the Executor to use for managing the timer notificationspublic TimeoutHttpRequesterFilter(BiFunction<HttpRequestMetaData,TimeSource,Duration> timeoutForRequest,
boolean fullRequestResponse,
Executor timeoutExecutor)
timeoutForRequest - function for extracting timeout from request which may also determine the timeout using
other sources. If no timeout is to be applied then the function should return nullfullRequestResponse - if true then timeout is for full request/response transaction otherwise only
the response metadata must arrive before the timeouttimeoutExecutor - the Executor to use for managing the timer notificationspublic StreamingHttpClientFilter create(FilterableStreamingHttpClient client)
create in interface StreamingHttpClientFilterFactorypublic StreamingHttpConnectionFilter create(FilterableStreamingHttpConnection connection)
create in interface StreamingHttpConnectionFilterFactorypublic final HttpExecutionStrategy requiredOffloads()
requiredOffloads in interface HttpExecutionStrategyInfluencerrequiredOffloads in interface ExecutionStrategyInfluencer<HttpExecutionStrategy>