[rabbitmq-discuss] WebSockets and Rabbit-mq
Jason J. W. Williams
jasonjwwilliams at gmail.com
Wed Oct 19 21:50:19 BST 2011
You'll need to create (and subscribe to) an anonymous queue to receive
replies. Then take the random name assigned by Rabbit to that queue
and stick it into the "replyto" header field of the messages your app
is publishing. When your backend processes the message it should use
the value of the "replyto" on the received message as the routing key
for the reply (published into the empty '' exchange). Publishing with
an empty exchange name will cause Rabbit to directly route the reply
message to the queue with the same name as the routing key.
On Wed, Oct 19, 2011 at 2:23 PM, Paul Cowan <dagda1 at scotalt.net> wrote:
> I am struggling to work out how I can communicate between rabbitmq and
> My are requirements for the piece of work are this.
> I want a user to be able to kick off from a web page a long running process
> that could take at least 20 minutes to finish.
> I want the process to complete even if the user closes down the browser.
> While the user still has the browser open, I want the user to be able to get
> real time updates of the long running process displayed in the browser.
> My thoughts are that the client script on the page will create a websocket
> connection that will kick off an EventMachine-Websocket instance on the
> server (I am using Ruby on Rails).
> The websocket instance will subscribe to an AMQP queue that will complete
> the long running process even if the browser is closed down.
> I am struggling with how the em-websocket instance will receive updates of
> the work that is being done which is effectively inserts into a database.
> Do I need 2 queues? One to start the process and one to receive updates or
> is there a better way?
> Can anybody shed any advice on this situation? Has anybody done anything
> Paul Cowan
> Cutting-Edge Solutions (Scotland)
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
More information about the rabbitmq-discuss