Class IdleTimeoutConnectionFilter

java.lang.Object
io.servicetalk.http.utils.IdleTimeoutConnectionFilter
All Implemented Interfaces:
HttpExecutionStrategyInfluencer, StreamingHttpConnectionFilterFactory, ExecutionStrategyInfluencer<HttpExecutionStrategy>

public final class IdleTimeoutConnectionFilter extends Object implements StreamingHttpConnectionFilterFactory
A connection-level filter that closes idle connections.

This filter is an alternative to ServiceTalkSocketOptions.IDLE_TIMEOUT at L7 layer. It helps to close idle connections that were not used to send any requests for the specified duration without affecting any in-flight requests.

  • Connections that have in-flight requests are considered "in-use".
  • If response payload body was not consumed, the connection is still considered "in-use" and does not start counting the timer.
  • A single connection can not process more than Integer.MAX_VALUE concurrent requests.
  • If filter is configured with Duration.ZERO timeout, it disables the timeout.