[openamq-dev] Fwd: Ruby QPID libraries

Gordon Sim gsim at redhat.com
Wed Apr 30 21:00:04 CEST 2008


Carl Bourne wrote:
> Thanks Gordon – that fixed it!
> 
> Still trying to understand the options available in the client. Could 
> you tell me what the following lines in the code do please?
> 
> c.start("\0guest\0guest", mechanism="PLAIN")

That sends a connection.start command to the broker and authenticates 
using SASL PLAIN as user guest with password guest.

> msg = c.queue("ctag").pop()

Messages that are delivered by the broker are identified by a 'tag' that 
the consumer specified when issuing the basic_consume command. On 
receipt at the client, messages are queued by delivery tag.

The c.queue("ctag") get the queue for the tag 'ctag'. The first message 
from that is then popped off (blocks if no-message exists).

> ch.basic_ack(msg.delivery_tag)

This acknowledges the message, allowing the broker to safely dequeue it.


More information about the openamq-dev mailing list