Using ActiveMQ to relay Websocket connection in Spring Websocket

In the previous tutorial, I showed you how to relay Websocket connection in Spring Websocket using RabbitMQ. You can also use ActiveMQ to do this. How is it in detail? We will find out together in this tutorial!

First, you need to start an ActiveMQ server, with Docker Compose, you need to expose port 61613 of the STOMP connection:

then in the StompBrokerRelay configuration in the previous tutorial example, we will use ActiveMQ’s information, like this:

Run the application again, then open 2 browser windows and enter your name in this browser, you will also see that both browsers receive messages from the WebSocket server.

Add Comment