Yes, each Receiver is closed right after its creation, before the next
attempt to declare the queue.
The behaviour you describe seems to contradict the specs to some
extent. The AMQP 0.10 specs says:
queue.declare, auto-delete:
If this field is set and the exclusive field is also set, then the
queue MUST be deleted when the session closes. If this field is set
and the exclusive field is not set the queue is deleted when all the
consumers have finished using it. Last consumer can be cancelled
either explicitly or because its
session is closed. If there was no consumer ever on the queue, it
won't be deleted.
The server MUST ignore the auto-delete field if the queue already exists.
My question is: If I declare an auto-delete queue by creating a
Receiver and then closing the Receiver, will the queue continue to
exist within the current Session? Does this depend on whether the
queue is exclusive?
The specs also says:
exchange.declare:
The server MUST ignore the durable field if the exchange already exists.
The server MUST ignore the auto-delete field if the exchange already exists.
Is this the case for Qpid?
Cheers
Jiri
On 07/27/2011 07:48 AM, Jiri Krutil wrote:
I'm experimenting with asserts in queue re-declarations using the C++
messaging client.
I start with a queue declaration using this address:
test-11;{assert:always, create:always, node:{durable:False, type:queue,
x-declare:{auto-delete:True, exclusive:True}}}
Is the sender or receiver created using this closed before testing
the other addresses? This has auto-delete and exclusive set, so when
the sender/receiver closes the queue will be deleted. A subsequent
test would then actually recreate the queue.
Then I try to re-declare the same queue using different node settings
for durable, x-bindings, x-declare(auto-delete, exclusive, arguments).
Since assert is enabled, I would expect to get an error whenever the
required settings differ from the actual settings of the existing queue.
(Well, maybe I would not expect the bindings to be checked, by the rest
yes.)
This however only seems to work for the durable attribute, but not for
the others (assert seems to ignore whatever is in x-declare and
x-bindings).
My questions are:
- Is that the expected behaviour?
- What exactly is assert supposed to check?
At present it only checks for capabilities requested that differ
from the defaults:
* If you have requested a durable queue, it will fail if the actual
queue is non-durable. The reverse test isn't currently applied; i.e.
you cannot at present assert that the queue is non-durable only that
it is durable.
* If you have requested that the queue is auto-delete, it will fail
if the actual queue does not have auto-delete set (again, the
reverse test is not currently applied).
* It checks that all the arguments specified are present and as
expected on the actual queue and fails if not.
* If you have requested a particular alternate-exchange it will fail
if that does not match the value set on the actual queue.
* If you have specified node bindings and they do not exist it will fail.
There is one further test that is actually useless. If you have
requested the queue to be exclusive and it is not, it will fail
(again, the reverse check is not applied). However if there is an
existing owner then the subscribe will fail anyway, and if there is
not, the assertion will happen before any declare and will fail.
- Can I detect a difference in required and actual x-declare and
x-bindings settings using the C++ messaging client v0.7?
These are the re-declare addresses I'm using (only the first one results
in an error):
test-11;{assert:always, create:always, node:{durable:True, type:queue,
x-declare:{auto-delete:True, exclusive:True}}}
test-11;{assert:always, create:always, node:{durable:False, type:queue,
x-declare:{auto-delete:True, exclusive:False}}}
test-11;{assert:always, create:always, node:{durable:False, type:queue,
x-declare:{auto-delete:False, exclusive:True}}}
test-11;{assert:always, create:always, node:{durable:False, type:queue,
x-bindings:[{exchange:amq.direct, key:test-11}],
x-declare:{auto-delete:True, exclusive:True}}}
test-11;{create:always, node:{durable:False, type:queue,
x-declare:{arguments:{qpid.file_count:1, qpid.file_size:256,
qpid.max_size:1024}, auto-delete:True, exclusive:True}}}
Cheers
Jiri
---------------------------------------------------------------------
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]