Problem: I have set exclusive to false in every place I can currently see to 
set exclusive to false and yet when the request comes in at the broker, 
exclusive = 1.

Address string:

"test/foobar.# ; {create: always, node: { type: topic, durable: false, 
x-declare:{ durable: false, exclusive: false, auto-delete: true }}, link: { 
name: 'foo_queue', durable: false, x-declare: { durable: false, exclusive: 
false } } }"

Results from qpidd --trace:

2011-04-25 19:21:58 trace RECV [127.0.0.1:37449]: Frame[BEbe; channel=1; 
{QueueDeclareBody: queue=test_foo_queue; alternate-exchange=; exclusive=1; 
auto-delete=1; arguments={}; }]

2011-04-25 19:21:58 trace anonymous.9e263d95-e512-45c3-b546-f87a5686f683: recv 
cmd 10: {QueueDeclareBody: queue=test_foo_queue; alternate-exchange=; 
exclusive=1; auto-delete=1; arguments={}; }
2011-04-25 19:21:58 debug anonymous.9e263d95-e512-45c3-b546-f87a5686f683: 
receiver marked completed: 10 incomplete: { } unknown-completed: { [0,10] }

2011-04-25 19:21:58 trace RECV [127.0.0.1:37449]: Frame[BEbe; channel=1; 
{ExchangeBindBody: queue=test_foo_queue; exchange=test; binding-key=foobar.#; 
arguments={}; }]
2011-04-25 19:21:58 trace anonymous.9e263d95-e512-45c3-b546-f87a5686f683: recv 
cmd 11: {ExchangeBindBody: queue=test_foo_queue; exchange=test; 
binding-key=foobar.#; arguments={}; }
2011-04-25 19:21:58 debug anonymous.9e263d95-e512-45c3-b546-f87a5686f683: 
receiver marked completed: 11 incomplete: { } unknown-completed: { [0,11] }

2011-04-25 19:21:58 trace RECV [127.0.0.1:37449]: Frame[BEbe; channel=1; 
{MessageSubscribeBody: queue=test_foo_queue; destination=test_2; accept-mode=1; 
acquire-mode=0; exclusive=1; resume-id=; resume-ttl=0; arguments={}; }]
2011-04-25 19:21:58 trace anonymous.9e263d95-e512-45c3-b546-f87a5686f683: recv 
cmd 12: {MessageSubscribeBody: queue=test_foo_queue; destination=test_2; 
accept-mode=1; acquire-mode=0; exclusive=1; resume-id=; resume-ttl=0; 
arguments={}; }

2011-04-25 19:21:58 debug Exception constructed: Queue test_foo_queue has an 
exclusive consumer. No more consumers allowed. (qpid/broker/Queue.cpp:482)
2011-04-25 19:21:58 error Execution exception: resource-locked: Queue 
test_foo_queue has an exclusive consumer. No more consumers allowed. 
(qpid/broker/Queue.cpp:482)
2011-04-25 19:21:58 trace SENT [127.0.0.1:37449]: Frame[BEbe; channel=1; 
{ExecutionExceptionBody: error-code=405; command-id=12; class-code=4; 
command-code=7; field-index=0; description=resource-locked: Queue 
test_foo_queue has an exclusive consumer. No more consumers allowed. 
(qpid/broker/Queue.cpp:482); error-info={}; }]

On Apr 25, 2011, at 1:58 AM, Jakub Scholz wrote:

> Hi David,
> 
> I believe you are looking for an address similar to this:
> 
> amq.topic/foo.#; {create: receiver, link: {name: 'foo_reciver_queue' ,
> x-declare: { auto-delete: true, exclusive: false } } }
> 
> It binds the topic exchange to a queue created by the receiver and
> named foo_receiver_queue using the key foo.#. This queue is created as
> auto-delete non-exclusive queue. You may want to change the queue
> parameters according to your needs. But you have to keep the
> exclusive: false parameter, else you will be unable to create multiple
> receivers on this queue.
> 
> I guess the getName() method of the receiver probably returns just
> some receiver name, not the queue name.
> 
> Hope it helps ...
> 
> Regards
> JAkub
> 
> On Sun, Apr 24, 2011 at 22:18, David Hawthorne <[email protected]> wrote:
>> I'm attempting to use the 0.8 messaging API and I don't see a way to specify 
>> the name of the queue to create or listen to using this API.  With the older 
>> API I could declare the queue with a known name, and thus have multiple 
>> clients draining the same queue using the same binding (round-robin consumer 
>> pattern).  It doesn't look like I can get the name of the queue created by 
>> createReceiver using Receiver.getName, either, because it only returns the 
>> name of the exchange.  e.g., if I have an exchange named "test", and I 
>> create a receiver with an address like "test/foobar.#; { create: always }", 
>> Receiver.getName() returns "test", whereas qpidd -t shows me the queue is 
>> actually "test_e54e7eff-3ae8-4508-b23a-0a0d8b2ef65f".
>> 
>> This almost leads me to the conclusion that it is not meant to be possible 
>> to round-robin pop messages off of a queue created on a topic exchange.  Is 
>> that the case?
>> 
>> code example:
>> 
>> {
>>                string queue_address = "test/foo.# ; { create: always, 
>> delete: always, node:{ type: topic, durable: false }}";
>> 
>>                qpid::messaging::Connection connection("127.0.0.1:5672");
>>                connection.open();
>>                qpid::messaging::Session session = connection.createSession();
>>                qpid::messaging::Receiver receiver = 
>> session.createReceiver(queue_address);
>> 
>>                // attempt to create a second receiver listening on the same 
>> queue to see what happens
>>                qpid::messaging::Receiver receiver2 = 
>> session.createReceiver(queue_address);
>> 
>>                cout << "receiver name is " << receiver.getName() << endl;
>>                cout << "receiver2 name is " << receiver2.getName() << endl;
>> 
>>                qpid::messaging::Message message;
>>                qpid::messaging::Duration timeout = 
>> qpid::messaging::Duration::SECOND;
>> 
>>                int messages_received = 0;
>> 
>>                while (receiver.fetch(msg, timeout))
>>                        messages_received++;
>> 
>>                while (receiver2.fetch(msg, timeout))
>>                        messages_received++;
>> 
>>                cout << "total messages received is " << messages_received << 
>> endl;
>> }
>> 
>> receiver name is test
>> receiver2 name is test_2
>> total messages received is 4, expected 2
>> 
>> I keep a count of the total messages received from all receivers, and I'm 
>> sending exactly 2 messages.  The total messages received should equal 2, but 
>> in this case it equals 4 because each receiver creates a new queue with a 
>> unique name and the messages are delivered to each of those, effectively 
>> preventing the round-robin capability of the old API.
>> 
>> Any help you can give would be greatly appreciated.
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:[email protected]
>> 
>> 
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:[email protected]
> 


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to