<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-ZA link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal>Hi guys,<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Quick one.....I have the following scenario:<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><span style='color:red'>Client sends message -> Mochiweb
HTTP Server -> AMQP Erlang client -> RabbitMQ -> PYTHON consumer<o:p></o:p></span></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Obviously the scenario suits ASYNCHRONOUS processing very
well.......but now I want to handle SYNCHRONOUS as well....? <o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>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 <span style='color:red'>and
blocks for a RESPONSE (waits for return message)</span>.....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
“<span style='color:red'>correlationID</span>”?) and sends it back
to the calling client.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><u>So basically how are synchronous scenarios handles in
RabbitMQ?</u> 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..<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>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?<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><u>So essentially the process will seem SYNCHRONOUS from
that calling client but will be ASYNCHRONOUS in the “internals”...</u><o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Any ideas?<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Thanks for the help ;-)<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Lynton<o:p></o:p></p>
</div>
</body>
</html>