I want to enable sockets in a Spring application and in the documentation came up 2 ways of using them, plain and with STOMP enabled.
I understand that the later is backed up by a message broker but did not find any good explanation of this feature.
So, my question would be, what does Spring bring in the back scenes when @EnableWebSocketMessageBroker
is used, compared to @EnableWebSocket
?
From what I have read so far, the difference consists in the fact that the later (@EnableWebSocketMessageBroker
) offers a better handling for the exchanged messages. In order to keep them somehow in controll, a very good approach is to use a message broker:
Note: the annotation @EnableWebSocketMessageBroker
does not by default add an underlying full-featured Broker, but a "Simple one".
The simple version:
A full-featured one will add more functionalities, that can be found on its presentation documentation. (read more in http://rstoyanchev.github.io/s2gx2013-websocket-browser-apps-with-spring)
Other nice to read reference: Message queues vs sockets, The MessageBroker WebSocket Subprotocol
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With