[rabbitmq-discuss] RabbitMQ Synchronous Client Example?

Lynton Grice lynton.grice at logosworld.com
Sat Jul 18 15:58:17 BST 2009

Hi guys,


Quick one.....I have the following scenario:


Client sends message -> Mochiweb HTTP Server -> AMQP Erlang client ->
RabbitMQ -> PYTHON consumer


Obviously the scenario suits ASYNCHRONOUS processing very well.......but now
I want to handle SYNCHRONOUS as well....? 


So what I would like is a SYNCHRONOUS scenario whereby the message goes from
the client -> Mochiweb HTTP server -> then to the AMQP Erlang client, this
then sends the message to RabbitMQ and blocks for a RESPONSE (waits for
return message).....then the Python consumer picks up the
message....processes it and sends the response to a "RESPONSE queue".....the
code then receives this response message (via some type of "correlationID"?)
and sends it back to the calling client.


So basically how are synchronous scenarios handles in RabbitMQ? Does anyone
have any example code in Erlang (or other) that shows how to process a
message with ID "123" in RabbitMQ and put the result of message "123" into
some other response queue..


Well I suppose when I speak of queues above maybe it should be
"exchange"....maybe with a "routing_key"? The "routing_key" could be an
internal "correlationID" of sorts?


So essentially the process will seem SYNCHRONOUS from that calling client
but will be ASYNCHRONOUS in the "internals"...


Any ideas?


Thanks for the help ;-)



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20090718/f1defce6/attachment.htm 

More information about the rabbitmq-discuss mailing list