таким образом
function connect() {
var socket = new SockJS('http://localhost:8080/chat-messaging');
stompClient = Stomp.over(socket);
stompClient.connect({}, function(frame) {
console.log("connected: " + frame);
stompClient.subscribe('http://localhost:8080/chat/messages', function(response) {
var data = JSON.parse(response.body);
draw("left", data.message);
});
});
}