Hot questions for Using RabbitMQ in sockjs


I am working on adding live notification in my application

I have done POC with - Spring Boot - Spring WebSocket - SockJS - RabbitMQ STOMP plugin

I read about RabbitMQ Web STOMP and want to do POC of that. But it says Since version 3.7 support for SockJS websocket emulation was removed.

Is there any example for Spring WebSocket + RabbitMQ Web STOMP with or without SockJS.

Please help.

Reference links:


@n.sharvarish... first create a websocket configuration class over rabbitmq like this...

public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
    private static final Logger log = LoggerFactory.getLogger(WebSocketConfig.class);
    private String userName;
    private String password;
    private String host;
    private int port;
    private String endpoint;
    private String destinationPrefix;
    private String stompBrokerRelay;
    public void configureMessageBroker(final MessageBrokerRegistry config) {
    public void registerStompEndpoints(final StompEndpointRegistry registry) {

and then ... use above config class where you want to use .. like this..

SimpMessagingTemplate template

template.convertAndSend(destinationurl, object);

and configure above username and password and all from


i hope someone can help me with this issue: I use the Websocket support of Spring. With SockJs and StompJs i subscribe a queue like this:

    var socket = new SockJS(localhost + 'websocket');
    stompClient = Stomp.over(socket);
    stompClient.connect('', '', function(frame) {
        stompClient.subscribe("/user/queue/gotMessage", function(message) {
    }, function(error) {

This works really fine with the SimpMessageSendingOperations of Spring. BUT there is one big problem. the Queue name looks like this: gotMessage-user3w4tstcj and its not declared as an auto delete queue, but this is what i want. Otherwise i have 10k of unused queues. In that moment where the queue as no consumer, the queue should be deleted. How can i assume this?


had same problem, from the documentation:

RabbitMQ creates auto-delete queues when destinations like /exchange/ are used. So in that case the client could subscribe to /user/exchange/

remember to add '/exchange/' as a destination prefix in stomp broker relay configuration


I'm using RabbitMQ, Spring and SockJS. My app generatea many different messages and posts them to rabbitmq via stomp. This generation requires a lot of resources so I want to know is there any subscriptions to rabbitmq and what kind of subscription it is (I need to know routing keys of this subscriptions) to avoid generating unnecessary messages. Is there any possibilities to get this information from Spring or any Java client library?


You can find all the information using one or more of the following