Description
Filip Hrisafov opened SPR-16801 and commented
Currently the StompBrokerRelayMessageHandler
uses the relayHost
and relayPort
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 customized TcpOperations
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 the StompBrokerRelayMessageHandler
are done and the fact that those fields are not used when custom TcpOperations
are provided.
I would propose to add a description
to the StompBrokerRelayMessageHandler
to allow the callers to provide customization for this information. Of course this would also require to add that to StompBrokerRelayRegistration
in order to be able to pass it to the message handler. The description can even be a Supplier
, which would allow to provide even more accurate information (in combination with the ClientOptions.Builder<?>
that can be passed to the ReactorNettyTcpClient
)
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:
- Spring Websockets Broker relay supporting a cluster of STOMP endpoint addresses [SPR-12452] #17057 Spring Websockets Broker relay supporting a cluster of STOMP endpoint addresses