-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
Add description for StompBrokerRelayMessageHandler [SPR-16801] #21341
Comments
Rossen Stoyanchev commented Indeed, after #17057 where TcpOperations can be configured through the Java config, it doesn't make sense to log the relay host and port. However, I'd prefer to avoid introducing yet another option into the mix that could also be easily overlooked. I experimented with
We could work with that in What is the version you're requesting this for? I did not check the output in 4.3.x yet. It may be different and the older reactor-net dependency is unlikely to change. Even there however you could wrap |
Filip Hrisafov commented We switched to Boot 2.0 and Spring 5. So for me it works to have it in 5.0.x only. I had a quick look in the
And In any case if the |
Rossen Stoyanchev commented Indeed TcpClient#toString isn't very helpful for a custom Supplier where the address is per connection. I don't see what it could show differently but a Reactor Netty ticket might make sense still, at least to avoid logging the address if a custom Supplier was given. Perhaps all we need to do in StompBrokerRelayMessageBroker is avoid logging the host and port, unless they were explicitly provided, and rely on logging from TcpClient instead? I see this with reactor.ipc at DEBUG level:
|
Filip Hrisafov commented I created a Reactor ticket (gh-353). Thanks for looking into it |
Rossen Stoyanchev commented Filip Hrisafov, to be clear what I meant is to stop logging any host or port information from StompBrokerRelayMessageHandler. Since that information may vary with each attempt to connect, it makes more sense to log it while connecting. TcpClient already logs something (the example from my previous comment) at DEBUG level, but we could also add a similar message in ReactorNettyTcpClient, for example around here so that changing the log level for spring-messaging would be self-sufficient. What do you think? |
Filip Hrisafov commented Not logging in the The last thing would be to change the |
Rossen Stoyanchev commented I've updated StompBrokerRelayMessageHandler to delegate logging to TcpOperations that in turn delegates to TcpClient. I've also added a debug log the actual address whenever a connection is established. |
Filip Hrisafov commented It's awesome. Thanks a lot |
Rossen Stoyanchev commented No worries, it's a logical complement to #17057. |
Filip Hrisafov opened SPR-16801 and commented
Currently the
StompBrokerRelayMessageHandler
uses therelayHost
andrelayPort
in its toString method and also when connecting the "system" session (here).In case no custom
TcpOperations
are provided then this is all good. However, if one needs to provide customizedTcpOperations
then the information that is logged is misleading.Currently I misusing the
relayHost
to put my custom information (like the list of the round robin addresses). However, this is quite brittle, as it relays on the fact that I know how the internals of theStompBrokerRelayMessageHandler
are done and the fact that those fields are not used when customTcpOperations
are provided.I would propose to add a
description
to theStompBrokerRelayMessageHandler
to allow the callers to provide customization for this information. Of course this would also require to add that toStompBrokerRelayRegistration
in order to be able to pass it to the message handler. The description can even be aSupplier
, which would allow to provide even more accurate information (in combination with theClientOptions.Builder<?>
that can be passed to theReactorNettyTcpClient
)An additional benefit of this would be in the case when a Spring Boot actuator endpoint is used where one can use the
BrokerAvailabilityEvent
to show the up / down status for STOMP. This is not yet part of Boot, but we have a custom endpoint that does this.Issue Links:
Referenced from: commits 37b0ed9, c555fef
The text was updated successfully, but these errors were encountered: