ebin123456 / py-amqplib

Automatically exported from code.google.com/p/py-amqplib
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Unable to detect publish failures returned via basic_return #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which version of amqplib are you using? 0.6.1

Have you checked to see if there is a newer version in the "Featured
Downloads" section of the front page of this project? Yes

Which broker are you using (RabbitMQ?) which version? RabbitMQ 2.4.1

Which version of Python? 2.6.5

What steps will reproduce the problem?
1. Create a connection.
2. Create a channel.
3. Declare an exchange.
4. Publish a message to the exchange with either immediate or mandatory flags 
set to True.
5. Close the channel.

What is the expected output? What do you see instead?
Expect to have a way to determine if the message could not be published. In my 
testing, I found that the AMQP server sent back a basic_return message, however 
it was never processed by amqplib and left in the Channel.method_queue.

Please provide any additional information below.

Original issue reported on code.google.com by pkwar...@gmail.com on 27 Apr 2011 at 6:48

GoogleCodeExporter commented 9 years ago
Here is a possible patch for the problem. This will process any outstanding 
basic_return responses on the method_queue when the channel is shut down.

Original comment by pkwar...@gmail.com on 27 Apr 2011 at 7:20

Attachments:

GoogleCodeExporter commented 9 years ago
It took me some time to wrap my head around this, but I think I've got this 
fixed in revision a2dea47310a1 , although it's a bit different than the 
supplied patch in that it processes basic_returns whenever we're reading from 
the server, not just on close().  

I also threw in a unittest that somewhat follows the steps to reproduce the 
problem from above, making sure the returned messages go into the 
Channel.returned_messages Queue object

Original comment by barry.pe...@gmail.com on 23 Jun 2011 at 2:44