-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Expose ChannelId in ReactorNettyWebsocketSession #26485
Comments
A |
logPrefix is based on ChannelId.shortText, which is nowhere nearly unique enough for logging purposes - longText is much more useful It would've been convenient to be able to compute the same unique or effectively unique value pertaining to a connection from both ChannelHandlerContext and ReactorNettyWebSocketSession |
The log prefix is unique, see #22039. It is also better to use a consistent log prefix. If you really want to change this, you can access the channel id via |
log prefix is, but it's not available from ChannelHandlerContext ChannelId in general and its longValue in particular fits the bill, except there's no public API to retrieve it using WebSocketSession As for your suggestion, request is accessible via ServerWebExchange in ReactorNettyRequestUpgradeStrategy.upgrade |
Thanks for the tip! A bit more casting than I'd like:
but I guess it is public API and probably more conventional than getting channel and id from WebSocketSession itself via reflection |
I thought |
not all, just in ReactorNettyWebsocketSession would be enough since it imples a particular server |
You would still have to downcast, but fine we can expose this for the Reactor Netty session. |
Thank you, @rstoyanchev |
Not a bug but proposal
This ID is much more unique than WebSocketSession's own, is already part of public APIs available to Netty handlers and could be used, for example, to correlate log events happening at different levels in a Webflux app without resorting to reflective access
The text was updated successfully, but these errors were encountered: