jmesnil / stomp-websocket

Stomp client for Web browsers and node.js apps
http://jmesnil.net/stomp-websocket/doc/
Apache License 2.0
1.43k stars 586 forks source link

Can't Subscribe to Header Exchange with User Defined Arguments #124

Open theironcook opened 8 years ago

theironcook commented 8 years ago

I want to use a Header Exchange.

I can use stomp.js to properly publish messages to my header exchange named "app-data".
var ws = new WebSocket('ws://x.x.x.x:15674/ws'); var client = Stomp.over(ws); client.send('/exchange/app-data', {locationID: 99}, JSON.stringify(jsonMessage));

If I create a subscription with Spring Boot to this exchange and specify the locationID header I can see that messages are properly routed based on the locationID.

Unfortunately, I can't get the stomp.js code to properly set the binding arguments.

client.subscribe('/exchange/app-data', myHandler, {locationID: 99});

I can't seem to set the queue's Binding Arguments to have an entry "locationID: 99" no matter what I do. Is this a bug in stomp.js?

theironcook commented 8 years ago

https://groups.google.com/forum/#!topic/rabbitmq-users/45IJkiPlrPA

Hmmm... Maybe STOMP doesn't really support Header Exchanges?