qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: How to use server-named queues in C++ client
Date Wed, 29 Jun 2011 10:24:18 GMT
On 06/29/2011 10:43 AM, Jiri Krutil wrote:
> I would like to understand how server-named queues (those with a # in
> the name) are to be used properly.

They aren't actually server named queues (as in early versions of AMQP). 
The # is simply a shortcut for creating a unique identifier in the 
address string (currently a UUID). That is done client side.

> If I want Qpid to expand the # with a UID, I have to declare the queue
> with delete:always, correct?
> The typical example of use of such a queue is:
> Sender sender = session.createSender("service_queue");
> Address responseQueue("#response-queue; {create:always, delete:always}");
> Receiver receiver = session.createReceiver(responseQueue);
> Do I have to use the Address object returned by createSender() to create
> the Receiver? I'm trying to use the queue name (as std::string), but
> that does not seem to work.

Sorry, I don't understand the question. Could you elaborate a little?

> Are these server-named queues exclusive and auto-delete?

No, not by default, though you can make them so. E.g.

"#response-queue; {create:always, node:{x-declare:{exclusive:True, 

Note the the 'x-' style address properties are version specific options 
that are primarily there to allow you to control the 0-10 declares etc 
if you want to. We hope to refine and expand the more general options also.

> Who can see them?

Anyone can see them (assuming ACL doesn't forbid it) but if they are 
exclusive then the usual rules apply (i.e. only the session who first 
declared them can use them).

> When are they delete by the broker?

An address with 'delete: always' will have the client delete the queue 
when the sender/receiver using the address is closed. That mode at 
present does have some issues (if you have multiple senders/receivers 
using the queue, the first to close would delete it from under the 
others; also if the client dies the queue can get left on the broker).

If you set auto-delete, then the queue is deleted by the broker when no 
longer used as per the rules in AMQP 0-10.

I'd like to improve the deletion policy a little here to get something 
simple and practical for the general case.

Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org

View raw message