Closed ashu8006kumar closed 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"
brokerMessagingTemplate.convertAndSendToUser("max.springer@virtuprep.com", "/notification/header", "hello, target user!")
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 .
It is fixed by changing /notification/header to topic
Client side code ` var socket = new SockJS("${createLink(uri: '/stomp')}"); var client = Stomp.over(socket);
Server side code
brokerMessagingTemplate.convertAndSendToUser("max.springer@virtuprep.com", "/notification/header", "hello, target user!")
andbrokerMessagingTemplate.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 .