Context
I'm trying to find the best way to combine Spring 5 WebClient
and Hystrix
. Using Hystrix, I set different timeouts for different type of requests done by the WebClient
.
When Hystrix
reaches it's timeout, I also want to make sure that WebClient
closes its connection. Previously when using AsyncHttpClient
, this was done by setting a requestTimeout
before performing the specific call. However, setting the request timeout on WebClient
is much more complicated and needs to be done on the ClientHttpConnector
according to this answer.
Brian Cozel mentions that it is optimal to share the same ClientHttpConnector
throughout the application. However, because the request specific timeout needs to be set on the ClientHttpConnector
, this does not seem possible.
Question
In Spring's Reactive WebClient
, is there a proper way to set request specific timeouts, but still use a single ClientHttpConnector
?