<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 5, 2013 at 6:52 AM, Lothe_Shashank <span dir="ltr">&lt;<a href="mailto:Lothe_Shashank@mahindrasatyam.com" target="_blank">Lothe_Shashank@mahindrasatyam.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-size:10pt;font-family:Tahoma"><span>�I modified amqp_listen.c example and instead of amqp_simple_wait_frame I used
</span><span><b>amqp_simple_wait_frame_noblock </b>with different timeout values. However this API is failing immediately with return value as -13. What this return value means?�</span></div></div></blockquote><div>�</div>
<div style>Values returned from the library should be compared to values in the amqp_status_enum (<a href="https://github.com/alanxz/rabbitmq-c/blob/master/librabbitmq/amqp.h#L334">https://github.com/alanxz/rabbitmq-c/blob/master/librabbitmq/amqp.h#L334</a>) �-13 I believe AMQP_STATUS_TIMEOUT.�</div>
<div style><br></div><div style><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="direction:ltr;font-size:10pt;font-family:Tahoma">
Is there any other way of using timeout so that if I don&#39;t receive a frame within say 10ms I can reject that message.<br></div><div><br></div></blockquote><div style>amqp_simple_wait_frame_noblock() operates at a low level: it doesn&#39;t deal with messages, it deals with frames that make up the message. �The timeout is specifying how long to wait for a single frame before giving up.</div>
<div style><br></div><div style>You would need to write some logic to wait for 10 ms for a complete message, then call amqp_basic_reject() on any message received after that moment.</div><div style>�</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div><div style="direction:ltr;font-size:10pt;font-family:Tahoma"><span>
<br>
Another problem I am facing with <b>amqp_basic_reject</b> API. In </span><span><span>amqp_listen.c example I called this API (with requeue=1) and I got following console output. After that it is not able to receive any message sent by
 amqp_send_string example.<br>
<br>
00000000: 48 65 6C 6C 6F 20 57 6F : 72 6C 64���������������� Hello World<br>
0000000B:<br>
Result 0<br>
Frame type 1, channel 1<br>
Method AMQP_CHANNEL_CLOSE_METHOD<br></span></span></div></div></blockquote><div><br></div><div style>When you receive a AMQP_CHANNEL_CLOSE METHOD it means that a channel exception has occurred, any consumers on that channel have been shutdown, and the channel can no longer be used.</div>
<div style><br></div><div style>You should cast frame.payload.method.decoded to amqp_channel_close_t* and examine the reply_text and error_code to see what went wrong. I&#39;m guessing invalid parameters were sent when you used the amqp_basic_reject function.</div>
<div style>�</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div style="direction:ltr;font-size:10pt;font-family:Tahoma">
<span><span>
<br>
</span>One more problem I would like to report. I have created a client 7 different queues with 7 different channels and bound with 7 different binding keys on the same connection with direct exchange. The listening part of these 7 queues are with 7 different
 threads listening for server input. </span></div></div></blockquote><div style><br></div><div style>rabbitmq-c is not threadsafe. �Using a connection from more than one thread will result in undefined behavior.�</div><div>
�</div></div></div></div>