zyro23 / grails-spring-websocket

93 stars 28 forks source link

Not able to send messages in grails 2.5.5 #46

Closed ashu8006kumar closed 7 years ago

ashu8006kumar commented 7 years ago

Client side code ` var socket = new SockJS("${createLink(uri: '/stomp')}"); var client = Stomp.over(socket);

    client.connect({}, function() {
        client.subscribe("/notification/header", function(message) {
            console.log(message.body);
        });
    });`

Server side code brokerMessagingTemplate.convertAndSendToUser("max.springer@virtuprep.com", "/notification/header", "hello, target user!") and brokerMessagingTemplate.convertAndSend "/notification/header", "TEST"

console messages:

`Web Socket Opened... stomp.js:145 >>> CONNECT accept-version:1.1,1.0 heart-beat:10000,10000

` after this nothing happened . I am using grails 2.5.5 and spring-websocket:1.3.1 .

ashu8006kumar commented 7 years ago

It is fixed by changing /notification/header to topic