-
Notifications
You must be signed in to change notification settings - Fork 38.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make use of Reactor Netty API for request id #26649
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Comments
rstoyanchev
added
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
labels
Mar 8, 2021
This was referenced Mar 16, 2021
This was referenced Mar 17, 2021
Closed
lxbzmy
pushed a commit
to lxbzmy/spring-framework
that referenced
this issue
Mar 26, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
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.The text was updated successfully, but these errors were encountered: