I have configured Spring Websocket over Stomp in my project.
My enviroment have 2 cluster node and one balancer. How can configure the spring websocket in cluster mode?
Thanks in advance
You need to use message broker like ActiveMQ / RabbitMQ etc. Either you can set a seperate node for message broker or you can also set it on any node in your 2 cluster node.
Next thing you need to configure enableStompBrokerRelay in your WebSocketConfig on both nodes.
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.setApplicationDestinationPrefixes("/app");
config.enableStompBrokerRelay("/topic","/queue").setRelayHost("MQHOSTNAME").setRelayPort(MQPORT);
}
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