We are using Jetty reactive http client as the httpclient in webClient. To do this we create ClientConnector object using JettyClientHttpConnector.java (from spring-web). Now the JettyClientHttpConnector.java doesn't have a way to set timeout for the jetty's HttpRequest. If timeout is not set then the request remains in the jettyclient queue until a response is received from server. This is causing problems during load/stress tests as jettyclient queue fills up to the maximum (when the server is too slow). Once queue is filled up "Max requests queued per destination" error is thrown after this no new request can be sent. Now to stop the queue fill up we need a way to set timeout to request, jetty has a way to set timeout for the requests, it's there in the HttpRequest.java class of jetty code. The only problem is JettyClientHttpConnector.java (from spring-web) doesn't have a way to set this timeout to the HttpRequest object created in connect() method.

Jetty HttpRequest.java timeout configuration -> https://www.eclipse.org/jetty/javadoc/current/org/eclipse/jetty/client/HttpRequest.html#timeout(long,java.util.concurrent.TimeUnit)

Comment From: rstoyanchev

@sathishkp85 your request is very similar to #25115 except that one is for Reactor Netty. You can see my https://github.com/spring-projects/spring-framework/issues/25115#issuecomment-674039558 there and I have the same question for you. Would the ability to register a Consumer<HttpRequest> in JettyClientHttpConnector work for you?

Comment From: sathishkp85

@rstoyanchev I checked #25115, if it's doable then I prefer making changes in WebClient to set request specific timeout. If making this in WebClient isn't possible then yes giving an ability to register a Consumer<HttpRequest> in JettyClientHttpConnector will work for me.

Comment From: rstoyanchev

This is now done, see usage snippets starting from this https://github.com/spring-projects/spring-framework/issues/25115#issuecomment-678434031.