[rabbitmq-discuss] AMQP & Python Write-Up
Jason J. W. Williams
jasonjwwilliams at gmail.com
Thu Jan 15 00:47:17 GMT 2009
Your comments on the typos are absolutely correct. That's what I get
for not double-checking the code that *didn't* make it into the full
Also, regarding the no_ack argument. Thank you (and Gordon) for the
correction. I will update the article to match the correct mechanism.
On Wed, Jan 14, 2009 at 5:28 PM, Barry Pederson <bp at barryp.org> wrote:
> Gordon Sim wrote:
>> Jason J. W. Williams wrote:
>>> I've written up a quick start on the basics of AMQP and using it in
>>> Python, that is the kind of document I wished I'd been able to find in
>>> one place: http://blogs.digitar.com/jjww/2009/01/rabbits-and-warrens/
>>> It's probably laced with errors, and I'd appreciate any
>> Nice article!
>> I am not that familiar with py-amqplib but the no_ack argument to
>> basic_consume/basic_get is defined in the AMQP spec to mean that the server
>> should not expect an ack and should discard the message on delivery. I.e.
>> its an unreliable mode of delivery rather than a signal to the client
>> library to automatically acknowledge on receiving a message.
> I just read the article too, very nice.
> Gordon's right about the no_ack flag, this sentence:
> If you set the no_ack argument to true, then py-amqplib will
> automatically send the acknowledgement immediately for you.
> should probably instead say something like what Gordon mentions above - it's
> the broker that acts differently based on that flag, not the client library.
> The only other thing I noticed was this section:
> Now, there's two methods of getting messages out of the queue. The first is
> to call chan.basic_get() to pull the next message off the queue:
> 1. msg = chan.basic_get("po_box")
> 2. print msg.body()
> 3. chan.basic_ack(msg.delivery_tag)
> If there isn't a message waiting in the queue when line 1 executes, then msg
> is set to None and line 2 will die since None does not have a "body"
> attribute. Also, body is not a function to call, it's just a string, so
> this would be more appropriate:
> msg = chan.basic_get("po_box")
> if msg is not None:
> print msg.body
More information about the rabbitmq-discuss