Description
Currently ReactorServerHttpRequest
sets the request id based on the Netty channel id and it also adds an integer that's incremented for each request to ensure a unique request id when connections are re-used for multiple requests. The request id is used for the log prefix to correlate messages.
This happens to align with Reactor Netty that also uses the channel id, but also the remote and local address. After reactor/reactor-netty#1530, Reactor Netty now provides an API for the request id it uses. It has a couple of advantages. One, the number appended to the connection id, is a local counter of requests on the connection, and not global one across all requests. Second, it offers the longer version with the local/remote address and connection status.
We can take advantage of this new API when Reactor Netty 1.0.5 or higher is on the classpath. It will help to remove an AtomicInteger
. For the longer version of the request id, we could perhaps use that when logging is as DEBUG level.