<div class="gmail_quote"><br>
<div>I have attached the code that i have implemented.</div>
<div> </div>
<div> </div>
<div> //declare a Input queue<br>                strQueue = InputQueue + &quot;.&quot; + objMessage.InputKey;<br>                model = GetModel();<br>                model.QueueDeclare(strQueue);<br>                model.QueueBind(strQueue, Exchange, objMessage.InputKey, true, null);</div>

<div>                //declare a Response queue<br>                strResponseQueue = ResponseQueue + &quot;.&quot; + objMessage.InputKey; ;<br>                modelResponse = GetModelForResponse();<br>                modelResponse.QueueDeclare(strResponseQueue);</div>

<div>                object msgTask = objMessage.Action;</div>
<div>                //Serialize the Message object<br>                MemoryStream stream = new MemoryStream();<br>                DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(Message));<br>
                jsonSerializer.WriteObject(stream, objMessage);</div>
<div>                byte[] messageBody = stream.ToArray();<br>                IBasicProperties msgProperties = model.CreateBasicProperties();<br>                msgProperties.AppId = RabbitHelper.AppID;<br>                msgProperties.Headers = new Dictionary&lt;string, object&gt;();<br>
                msgProperties.Headers.Add(&quot;MessageTask&quot;, msgTask);<br>                msgProperties.MessageId = Guid.NewGuid().ToString();<br>                MessageID = msgProperties.MessageId;<br>                </div>

<div>                modelResponse.QueueBind(strResponseQueue, Exchange, MessageID, true, null);</div>
<div>                model.BasicPublish(Exchange, objMessage.InputKey, msgProperties, messageBody);<br> subscription = new Subscription(modelResponse, strResponseQueue, false);</div>
<div>                while (subscription.Next(-1, out basicArgs))<br>                {<br>                    if (!object.ReferenceEquals(basicArgs, null))<br>                    {<br>                        IBasicProperties props = basicArgs.BasicProperties;<br>
                        byte[] responseMessageBody = basicArgs.Body;</div>
<div>                        //Deserialize the message object<br>                        IMessage recvMessage = RabbitHelper.ConvertJsonToObject&lt;Message&gt;(responseMessageBody);<br> //validate if this is the desired response<br>
                        if (props.MessageId == MessageID)<br>                        {<br>                            retVal = recvMessage.ReturnValue;<br>                            //acknowledge the queue <br>                            subscription.Ack(basicArgs);<br>
                        }<br>                    }<br>                } </div>
<div> </div>
<div> </div>
<div><br>Thanks and Regards,</div>
<div>Joe <br></div>
<div class="HOEnZb">
<div class="h5">
<div class="gmail_quote">On Thu, Sep 6, 2012 at 5:00 PM, Emile Joubert <span dir="ltr">&lt;<a href="mailto:emile@rabbitmq.com" target="_blank">emile@rabbitmq.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">Hi Joemon,<br>
<div><br>On 06/09/12 11:53, Joemon Varghese wrote:<br>&gt;  We are not able to reproduce this issue.We are  getting thread abort error.<br><br></div>Ok, but that does not sound like deadlock.<br>
<div><br>&gt;    Is there any chances of message being automatically<br>&gt; deleted from Queue after certain amount of time.?<br><br></div>Yes: messages may be removed from a queue if the queue was declared with<br>TTL: <a href="http://www.rabbitmq.com/ttl.html#per-queue-message-ttl" target="_blank">http://www.rabbitmq.com/ttl.html#per-queue-message-ttl</a><br>

<div><br>&gt;  because  sometimes my queries will take more than 1 hour but still i am<br>&gt; keep on polling for the Response queue  for this     mesage id.<br><br></div>I&#39;m afraid you have not provided enough information for me to<br>
investigate any further. If you can reproduce the problem then please<br>provide a description of the steps to reproduce, or a minimal<br>self-contained piece of code that triggers the failure. In the meantime<br>here are some suggestions:<br>
<br>- v2.7.1 is very old now. Upgrade to the latest version<br>- Try not to use polling<br><span><font color="#888888"><br><br><br>-Emile<br><br></font></span></blockquote></div><br></div></div></div><br>