<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 "tnc" 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"><<a href="mailto:tilak.chauhan@ymail.com" target="_blank">tilak.chauhan@ymail.com</a>></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>
>> Something in your code rejects messages with unknown delivery tag. This<br>
>> 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'm using `basic_get` method to consume messages.<br>
<div class="im"><br>
>> Can you post a fragment of your code that rejects messages and also be<br>
>> 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'm using.<br>
<br>
</div>Here is my code sample :<br>
<br>
$connection = new AMQPConnection(HOST, PORT, USER, PASS, VHOST);<br>
$channel = $connection->channel();<br>
$channel->queue_declare($queue, false, true, false, false);<br>
$channel->exchange_declare('myexchange', 'direct', true, true, false);<br>
$channel->queue_bind('myqueue', $exchange, $queue);<br>
<br>
while ($msg = $channel->basic_get($queue)) {<br>
consumerMessage($msg, $connection, $channel);<br>
}<br>
<br>
$channel->close();<br>
$connection->close();<br>
<br>
function consumerMessage($msg, $connection, $channel){<br>
$data = json_decode($msg->body, true);<br>
IF(thisConsumerIsNotAllowedToConsumeThisMessage){<br>
$channel->basic_ack($msg->delivery_info['delivery_tag']);<br>
return;<br>
}<br>
<br>
DoAllDataProcessing($data);<br>
$channel->basic_ack($msg->delivery_info['delivery_tag']);<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>