When sending requests via WebClient, if the request is successfully sent but a ReadTimeoutException occurs, the event of the request being sent is not logged. Additionally, the logging of the request occurs when the response is returned, rather than at the moment the request is made.
Expected Behavior
The request should be logged at the moment it is sent, regardless of whether a ReadTimeoutException occurs.
Actual Behavior
Currently, if a ReadTimeoutException is thrown, there is no log entry indicating that the request was sent. Logging occurs only when the response is received, which might never happen if a timeout occurs.
Possible Fix
Log the request immediately when the function is called, not after the response is returned.
Steps to Reproduce
Send a request via WebClient.
Simulate a scenario where the request is sent but the response is delayed or results in a ReadTimeoutException.
Check the logs to see that the request was not logged at the time it was sent.
Observe that the logging only occurs upon receiving a response (or not at all in the case of a timeout).
Context
This bug affects the ability to track and debug issues related to outgoing requests, particularly when responses are delayed or result in timeouts.
Your Environment
Version used: org.zalando:logbook-spring-boot-webflux-autoconfigure:2.16.0
Description
When sending requests via WebClient, if the request is successfully sent but a
ReadTimeoutException
occurs, the event of the request being sent is not logged. Additionally, the logging of the request occurs when the response is returned, rather than at the moment the request is made.Expected Behavior
The request should be logged at the moment it is sent, regardless of whether a
ReadTimeoutException
occurs.Actual Behavior
Currently, if a
ReadTimeoutException
is thrown, there is no log entry indicating that the request was sent. Logging occurs only when the response is received, which might never happen if a timeout occurs.Possible Fix
Log the request immediately when the function is called, not after the response is returned.
Steps to Reproduce
ReadTimeoutException
.Context
This bug affects the ability to track and debug issues related to outgoing requests, particularly when responses are delayed or result in timeouts.
Your Environment
Draft decision
Maybe you should add
doOnError