<div dir="ltr">Hi,<div><br></div><div style>I have some questions:</div><div><br></div><div style>1) Why are you using <span style="font-family:arial,sans-serif;font-size:13px">basic_get instead of basic_consume as shown here: </span><font face="arial, sans-serif"><a href="https://github.com/videlalvaro/php-amqplib/blob/master/demo/amqp_consumer.php#L66">https://github.com/videlalvaro/php-amqplib/blob/master/demo/amqp_consumer.php#L66</a> This is much faster.</font></div>
<div style><font face="arial, sans-serif"><br></font></div><div style><font face="arial, sans-serif">2) The &quot;tnc&quot; version of the library is not maintained anymore since 2 years already. There are many bug fixes in this version of the library: </font><span style="font-family:arial,sans-serif"><a href="https://github.com/videlalvaro/php-amqplib/">https://github.com/videlalvaro/php-amqplib/</a></span></div>
<div style><span style="font-family:arial,sans-serif"><br></span></div><div style><span style="font-family:arial,sans-serif">3) As Michael pointed out, do you have any basic_reject calls in your code?</span></div><div style>
<span style="font-family:arial,sans-serif"><br></span></div><div style><span style="font-family:arial,sans-serif">Regards,</span></div><div style><span style="font-family:arial,sans-serif"><br>Alvaro</span></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Jun 7, 2013 at 12:13 PM, tluck <span dir="ltr">&lt;<a href="mailto:tilak.chauhan@ymail.com" target="_blank">tilak.chauhan@ymail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi MK,<br>
<div class="im"><br>
&gt;&gt; Something in your code rejects messages with unknown delivery tag. This<br>
&gt;&gt; causes<br>
the channel to be closed.<br>
<br>
</div>Even if a channel is being closed then why script has not been terminated ?.<br>
I&#39;m using `basic_get` method to consume messages.<br>
<div class="im"><br>
&gt;&gt; Can you post a fragment of your code that rejects messages and also be<br>
&gt;&gt; more specific about which PHP library you use?<br>
<br>
</div><div class="im"><a href="https://github.com/tnc/php-amqplib" target="_blank">https://github.com/tnc/php-amqplib</a> -- This is the php library I&#39;m using.<br>
<br>
</div>Here is my code sample :<br>
<br>
$connection = new AMQPConnection(HOST, PORT, USER, PASS, VHOST);<br>
$channel = $connection-&gt;channel();<br>
$channel-&gt;queue_declare($queue, false, true, false, false);<br>
$channel-&gt;exchange_declare(&#39;myexchange&#39;, &#39;direct&#39;, true, true, false);<br>
$channel-&gt;queue_bind(&#39;myqueue&#39;, $exchange, $queue);<br>
<br>
while ($msg = $channel-&gt;basic_get($queue)) {<br>
    consumerMessage($msg, $connection, $channel);<br>
}<br>
<br>
$channel-&gt;close();<br>
$connection-&gt;close();<br>
<br>
function consumerMessage($msg, $connection, $channel){<br>
        $data = json_decode($msg-&gt;body, true);<br>
        IF(thisConsumerIsNotAllowedToConsumeThisMessage){<br>
            $channel-&gt;basic_ack($msg-&gt;delivery_info[&#39;delivery_tag&#39;]);<br>
            return;<br>
        }<br>
<br>
        DoAllDataProcessing($data);<br>
        $channel-&gt;basic_ack($msg-&gt;delivery_info[&#39;delivery_tag&#39;]);<br>
        return;<br>
}<br>
<br>
<br>
Thanks,<br>
T.luck<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://rabbitmq.1065348.n5.nabble.com/Script-Connection-not-getting-terminated-tp27265p27271.html" target="_blank">http://rabbitmq.1065348.n5.nabble.com/Script-Connection-not-getting-terminated-tp27265p27271.html</a><br>

<div class="HOEnZb"><div class="h5">Sent from the RabbitMQ mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</div></div></blockquote></div><br></div>