<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:"times new roman", "new york", "times", serif;font-size:12pt"><div>
<div>Hi,<br></div><div>&nbsp; I'm struggling with a simple concept of synchronous communication with rabbitMQ, in terms of getting a response message back to the client. </div><div><br></div><div>I'm trying to work out how to send it and also what the client will need to do to receive the message?</div><div><br></div><div>I have an exchange defined, I create a model, and queue, use .Call() and it arrives in my "server". FYI syntax below is C#.NET 4.</div><div><br></div><div>client side:</div><div><pre style="font-family:Consolas;font-size:13;color:black;background:white;">
model.ExchangeDeclare(ExchangeName, <span style="color:#a31515;">"direct"</span>);<br><pre style="font-family:Consolas;font-size:13;color:black;background:white;"><span style="color:blue;">var</span>&nbsp;queueName&nbsp;=&nbsp;ch.QueueDeclare(queueId,&nbsp;<span style="color:blue;">false</span>,&nbsp;<span style="color:blue;">false</span>,&nbsp;<span style="color:blue;">false</span>,&nbsp;<span style="color:blue;">null</span>);</pre></pre></div><div><pre style="font-family:Consolas;font-size:13;color:black;background:white;"><span style="color:blue;">var</span>&nbsp;client&nbsp;=&nbsp;<span style="color:blue;">new</span>&nbsp;<span style="color:#2b91af;">SimpleRpcClient</span>(model, queueName)<br><pre style="font-family:Consolas;font-size:13;color:black;background:white;"><span style="color:blue;">var</span> replyMessageBytes = client.Call(msgToSend);</pre>
</pre>server side:</div><div><pre style="font-family:Consolas;font-size:13;color:black;background:white;"><span style="color:green;">//similar setup like client side </span>
</pre></div><div><pre style="font-family:Consolas;font-size:13;color:black;background:white;"><span style="color:blue;">var</span> model = conn.CreateModel()
</pre></div><div><pre style="font-family:Consolas;font-size:13;color:black;background:white;">
model.BasicGet(queueName, <span style="color:blue;">false</span>);<br><br><pre style="font-family:Consolas;font-size:13;color:black;background:white;">ch.BasicAck(msg.DeliveryTag,&nbsp;<span style="color:blue;">false</span>);<br><pre style="font-family:Consolas;font-size:13;color:black;background:white;"><span style="color:blue;">byte</span>[] response; <span style="color:green;">//...</span>
</pre><span style="color:green;">//how do I send a response?</span></pre></pre></div><div>client side:</div><div><br></div><div><pre style="font-family:Consolas;font-size:13;color:black;background:white;"><span style="color:green;">//what does the client do to retrieve the ACK and RESPONSE.</span>
</pre></div><div><br></div><div>I had a search of the mailing list archive and couldn't find a similar question
&nbsp;<br></div><div><br></div><div>Thanks &amp;</div><div>Regards</div><div>-mp</div><br></div>


</div></body></html>