Answer the question
In order to leave comments, you need to log in
How to subscribe via websockets to a dynamic list of subscriptions in spring?
The task is as follows. API needs to be implemented. This api contains two kinds of methods:
1) normal (synchronous) methods implemented via REST requests, for example
$.ajax({
method:'GET',
url: "localhost:8080/api/v1/some/resource",
data: {
param1: value1,
param2: value2
}
success: function(data) {
// do something...
}
});
var socket = new SockJS('/api/stomp');
stompClient = Stomp.over(socket);
stompClient.connect({}, function(frame) {
stompClient.subscribe('/api/v1/some/subscription', function(message){
console.log(message);
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question