Skip to content
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

Closed
rstoyanchev opened this issue Mar 8, 2021 · 0 comments
Closed

Make use of Reactor Netty API for request id #26649

rstoyanchev opened this issue Mar 8, 2021 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@rstoyanchev
Copy link
Contributor

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.

@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement labels Mar 8, 2021
@rstoyanchev rstoyanchev added this to the 5.3.5 milestone Mar 8, 2021
@rstoyanchev rstoyanchev self-assigned this Mar 8, 2021
This was referenced Mar 16, 2021
This was referenced Mar 17, 2021
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
Projects
None yet
Development

No branches or pull requests

1 participant