I'm new to Java and Spring, and I'm wondering if it's possible to write my own HttpClient doOnConnected handler. The main reason for this is to check if some headers exist before each request and possibly do other things.
Something like this in c#
My code for example:
HttpClient httpClient = HttpClient.create()
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000)
.responseTimeout(Duration.ofMillis(5000))
.doOnConnected(conn ->
conn.addHandlerLast(new ReadTimeoutHandler(5000, TimeUnit.MILLISECONDS))
.addHandlerLast(new WriteTimeoutHandler(5000, TimeUnit.MILLISECONDS))
.addHandlerLast(new MyCustomHandler()
);