As in the newest Spring 4 tutorial with STOMP and SockJS, we find a RequestMapping of the following kind :
Homecontroller.java
@MessageMapping("/hello")
@SendTo("/topic/greetings")
public Greeting greeting(HelloMessage message) throws Exception {
Thread.sleep(3000); // simulated delay
return new Greeting("Hello, " + message.getName() + "!");
}
now I tried to realize multichannel support by modifying this requestmapping:
@MessageMapping("/hello/{id}")
@SendTo("/topic/greetings/{id}")
public Greeting greetingMultichannel(HelloMessage message) throws Exception {
this.info();
Thread.sleep(300); // simulated delay
return new Greeting(" Hello, " + message.getName() + "!");
}
the MessageMapping does not work,sendTo does not deliver back to the sepecified URL. Although I did subscribe to the right channel and the message goes out without problems, as seen in this
debug log:
Opening Web Socket... stomp.js:130 Web Socket Opened... stomp.js:130
CONNECT accept-version:1.1,1.0 heart-beat:10000,10000
stomp.js:130 <<< CONNECTED heart-beat:0,0 version:1.1
stomp.js:130 connected to server undefined stomp.js:130 Connected: CONNECTED version:1.1 heart-beat:0,0
(index):23
SUBSCRIBE id:sub-0 destination:/topic/greetings/1
stomp.js:130
SEND destination:/app/hello/1 content-length:18
{"name":"textext"}
there should be a response but there is nothing coming back..
Can someone see what I am missing here?
cheers, Heinrich