rabbitmq / rabbitmq-web-stomp

Provides support for STOMP over WebSockets
Other
89 stars 26 forks source link

Non ws browsers behind clustered rmq #7

Closed redsquare closed 9 years ago

redsquare commented 10 years ago

Hi, I have a three node cluster of rabbitmq load balanced by nginx (tried haproxy also). When I use sock.js/stomp.js to connect on either ie9/android stock (basically and non ws client) then I cannot connect and hold an open connection. I believe this is due to the cowboy plugin/webserver doing things in memory so when the next request comes into a different node there is no knowledge of the address. This happens with the /stomp/xhr_send routes. Is there no way to ha this across the cluster or do we need to deploy 'sticky/ip_hash' sessions?

redsquare commented 10 years ago

I undertstand the issue better, its down to webstomp creating exclusive queues which do not get mirrored meaning any non websocket browser client must end up polling to the same node.

michaelklishin commented 9 years ago

Yes, this is an interesting consequence of using exclusive queues. This depends on https://github.com/rabbitmq/rabbitmq-stomp/issues/24, then.

michaelklishin commented 9 years ago

@essen now that https://github.com/rabbitmq/rabbitmq-stomp/issues/24 is fixed, we can look into propagating endpoint/queue attributes for Web STOMP clients, too:

via headers or similar. What do you think?

essen commented 9 years ago

I think I need to read more about it before I can answer that. :-)

I'll get back to you.

essen commented 9 years ago

From what I understand, we shouldn't have to do anything.

The Web STOMP plugin just receives STOMP data as part of Websocket frames or other. There's no filtering going on that I can tell, we call rabbit_stomp_processor directly. This means that if you set the STOMP headers they will be propagated to rabbitmq-stomp and rabbitmq-stomp will handle them as expected.

I can experiment to confirm. How can I know if a queue is either durable/auto-delete/exclusive, though?

michaelklishin commented 9 years ago

@essen you can take a look at what flags (D, AD, E) it has in the management UI or list queues with rabbitmqctl. I'll assume this is closed, feel free to give it a try and re-open if things don't work as intended in master.