You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by David Hawthorne <dh...@3crowd.com> on 2010/11/19 01:22:42 UTC
cannot auto-delete exchange using the messaging API
I'm trying to use the messaging API, and I want the exchanges and queues created by my client and server software to be removed from the qpid server once all clients using them have exited/disconnected. The problem is that the queues *are* being destroyed, but the exchanges are *not*, and there is 1 response-queue exchange per each response-queue queue. I've confirmed that the queue bound to the exchange has been destroyed, and the binding has been destroyed as well. This is using the .6 API.
I've tried:
qpid::messaging::Address reply_to_address("#response-queue; {create:always, delete:always, node-properties:{type:topic, x-properties: {auto-delete:true}}}");
qpid::messaging::Receiver receiver = session.createReceiver(reply_to_address);
I ran the client program 3 times and this is the information I see about the exchanges created using qpid-tool afterwards:
qpid: list exchange
Objects of type org.apache.qpid.broker:exchange
...
111 23:41:33 - 103.84fc9811-81c1-4d4a-8886-18417da94d4c#response-queue
112 23:44:51 - 103.2b8db04b-3308-4d08-bec6-54ae64514d16#response-queue
142 23:55:59 - 103.ea74e839-9ea0-4030-820c-9aca0848f924#response-queue
The important bit to note here is that autoDelete is False when I want it to be true:
qpid: show exchange 111
Object of type org.apache.qpid.broker:exchange: (last sample time: 23:44:00)
Type Element 111
===================================================================================
property vhostRef 103
property name 84fc9811-81c1-4d4a-8886-18417da94d4c#response-queue
property type topic
property durable False
property autoDelete False
qpid: show exchange 142
Object of type org.apache.qpid.broker:exchange: (last sample time: 00:03:30)
Type Element 142
===================================================================================
property vhostRef 103
property name ea74e839-9ea0-4030-820c-9aca0848f924#response-queue
property type topic
property durable False
property autoDelete False
The queues have been deleted properly, though:
qpid: list queue
Objects of type org.apache.qpid.broker:queue
ID Created Destroyed Index
========================================================================================================================
...
143 23:55:59 00:03:26 103.ea74e839-9ea0-4030-820c-9aca0848f924#response-queue_5d00496a-d540-49d9-be28-01d6a145206c
qpid: show queue 143
Object of type org.apache.qpid.broker:queue: (last sample time: 00:03:30)
Type Element 143
============================================================================================================================
property vhostRef 103
property name ea74e839-9ea0-4030-820c-9aca0848f924#response-queue_5d00496a-d540-49d9-be28-01d6a145206c
property durable False
property autoDelete True
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
Re: cannot auto-delete exchange using the messaging API
Posted by Gordon Sim <gs...@redhat.com>.
On 11/19/2010 12:22 AM, David Hawthorne wrote:
> I'm trying to use the messaging API, and I want the exchanges and queues created by my client and server software to be removed from the qpid server once all clients using them have exited/disconnected. The problem is that the queues *are* being destroyed, but the exchanges are *not*, and there is 1 response-queue exchange per each response-queue queue. I've confirmed that the queue bound to the exchange has been destroyed, and the binding has been destroyed as well. This is using the .6 API.
>
> I've tried:
>
> qpid::messaging::Address reply_to_address("#response-queue; {create:always, delete:always, node-properties:{type:topic, x-properties: {auto-delete:true}}}");
> qpid::messaging::Receiver receiver = session.createReceiver(reply_to_address);
Do you really want the reply_to_address to be a topic? Will any other
receiver subscribe to that? If so how do they get the correct name since
it is a uniquely generated one? If not, why not just use a response queue.
> I ran the client program 3 times and this is the information I see about the exchanges created using qpid-tool afterwards:
>
> qpid: list exchange
> Objects of type org.apache.qpid.broker:exchange
> ...
> 111 23:41:33 - 103.84fc9811-81c1-4d4a-8886-18417da94d4c#response-queue
> 112 23:44:51 - 103.2b8db04b-3308-4d08-bec6-54ae64514d16#response-queue
> 142 23:55:59 - 103.ea74e839-9ea0-4030-820c-9aca0848f924#response-queue
>
> The important bit to note here is that autoDelete is False when I want it to be true:
The c++ broker does not yet support auto-deleted exchanges. However, the
delete:always should cause the reciever/sender to delete it when it
closes (I've verified that with the latest code). That of course is not
always what you want where you have multiple senders/receivers.
> qpid: show exchange 111
> Object of type org.apache.qpid.broker:exchange: (last sample time: 23:44:00)
> Type Element 111
> ===================================================================================
> property vhostRef 103
> property name 84fc9811-81c1-4d4a-8886-18417da94d4c#response-queue
> property type topic
> property durable False
> property autoDelete False
>
> qpid: show exchange 142
> Object of type org.apache.qpid.broker:exchange: (last sample time: 00:03:30)
> Type Element 142
> ===================================================================================
> property vhostRef 103
> property name ea74e839-9ea0-4030-820c-9aca0848f924#response-queue
> property type topic
> property durable False
> property autoDelete False
>
> The queues have been deleted properly, though:
>
> qpid: list queue
> Objects of type org.apache.qpid.broker:queue
> ID Created Destroyed Index
> ========================================================================================================================
> ...
> 143 23:55:59 00:03:26 103.ea74e839-9ea0-4030-820c-9aca0848f924#response-queue_5d00496a-d540-49d9-be28-01d6a145206c
>
> qpid: show queue 143
> Object of type org.apache.qpid.broker:queue: (last sample time: 00:03:30)
> Type Element 143
> ============================================================================================================================
> property vhostRef 103
> property name ea74e839-9ea0-4030-820c-9aca0848f924#response-queue_5d00496a-d540-49d9-be28-01d6a145206c
> property durable False
> property autoDelete True
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project: http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org