You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Michael Ivanov <iv...@logit-ag.de> on 2015/11/03 18:57:43 UTC

Autodelete queues not deleted

Hallo,

Please help me to resolve the following situation:

I create a temporary queue using "/#" suffix to amqp url. The queue is created
with name like 36275A5C-8630-457B-BD75-3664354ECC2D_#

I set this queue as reply_to address in messages being sent. I receive the reply
message and run pn_messenger_accept() for it (I use CUMULATIVE flag just in case).
When I check this queue using qpid-stat -q I see that the queue has autoDel flag
set. When the queue was just created but not used, then everything is fine, the
queue is deleted when it's owning process exits. But as soon as the queue is used
to send a reply for at least one message then it is not deleted when owner process
is terminated. It still hangs there with bind == 1 and connections set to 0.

It can be deleted with qpid-config del queue, but without any explicit action it
stays there until the process that has sent a reply, terminates. It is not reused.

Can this be fixed and how can I investigate it further?

Bets regards,
-- 
 \   / |			           |
 (OvO) |  Mikhail Iwanow                   |
 (^^^) |                                   |
  \^/  |      E-mail:  ivans@logit-ag.de   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Robbie Gemmell <ro...@gmail.com>.
That filename looks like it for the AMQP 0-x JMS client. Gordon and I
were referring to the two AMQP 1.0 JMS clients as you had mentioned
using the earlier of those ('qpid-amqp-1-0-client-jms', in this case
0.30) in a previous mail. The newer AMQP 1.0 JMS client we mentioned
is the 'qpid-jms-client' 0.6.0 release. You can find details of all
the latest artifacts on the website, e.g:

http://qpid.apache.org/components/jms/index.html
http://qpid.apache.org/download.html
http://qpid.apache.org/maven.html

Robbie

On 5 November 2015 at 13:03, Michael Ivanov <iv...@isle.spb.ru> wrote:
> I just tried qpid-client-0.32-bin.tar.gz (we were using 0.30). Still the same.
> Is this version to be considered new or should I search for sthing else?
>
> Best regards,
>
> 05.11.2015 15:37, Gordon Sim пишет:
>> On 11/05/2015 12:06 PM, Robbie Gemmell wrote:
>>> On 5 November 2015 at 11:45, Gordon Sim <gs...@redhat.com> wrote:
>>>> If there was a way to configure the dynamic-node-properties requested in
>>>> this case, then the desired lifetime-policy could be selected. (I had
>>>> incorrectly assumed that the 'S' process was also using messenger). Can
>>>> anyone familiar with the 'original' 1.0 JMS client comment on whether the
>>>> dynamic-node-properties are configurable in any way?
>>>
>>> Having a peek at the source, the dynamic node properties aren't
>>> configurable and are not being set when the 'original' 1.0 JMS client
>>> creates a temporary destination.
>>
>> Thanks for confirming!
>>
>>> The new JMS client sets them with delete-on-close for the lifetime
>>> policy when creating temporary destinations.
>>
>> Ok, so one option might be to use that new client. (Caveat, I have not tried that out myself and as I've already demonstrated on
>> this thread my instincts are not to be trusted).
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
>> For additional commands, e-mail: users-help@qpid.apache.org
>>
>
>
> --
>  \   / |                                   |
>  (OvO) |  Михаил Иванов                    |
>  (^^^) |      Тел.:    +7(911) 223-1300    |
>   \^/  |      E-mail:  ivans@isle.spb.ru   |
>   ^ ^  |                                   |
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Michael Ivanov <iv...@isle.spb.ru>.
I just tried qpid-client-0.32-bin.tar.gz (we were using 0.30). Still the same.
Is this version to be considered new or should I search for sthing else?

Best regards,

05.11.2015 15:37, Gordon Sim пишет:
> On 11/05/2015 12:06 PM, Robbie Gemmell wrote:
>> On 5 November 2015 at 11:45, Gordon Sim <gs...@redhat.com> wrote:
>>> If there was a way to configure the dynamic-node-properties requested in
>>> this case, then the desired lifetime-policy could be selected. (I had
>>> incorrectly assumed that the 'S' process was also using messenger). Can
>>> anyone familiar with the 'original' 1.0 JMS client comment on whether the
>>> dynamic-node-properties are configurable in any way?
>>
>> Having a peek at the source, the dynamic node properties aren't
>> configurable and are not being set when the 'original' 1.0 JMS client
>> creates a temporary destination.
> 
> Thanks for confirming!
> 
>> The new JMS client sets them with delete-on-close for the lifetime
>> policy when creating temporary destinations.
> 
> Ok, so one option might be to use that new client. (Caveat, I have not tried that out myself and as I've already demonstrated on
> this thread my instincts are not to be trusted).
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 


-- 
 \   / |			           |
 (OvO) |  Михаил Иванов                    |
 (^^^) |      Тел.:    +7(911) 223-1300    |
  \^/  |      E-mail:  ivans@isle.spb.ru   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Gordon Sim <gs...@redhat.com>.
On 11/05/2015 12:06 PM, Robbie Gemmell wrote:
> On 5 November 2015 at 11:45, Gordon Sim <gs...@redhat.com> wrote:
>> If there was a way to configure the dynamic-node-properties requested in
>> this case, then the desired lifetime-policy could be selected. (I had
>> incorrectly assumed that the 'S' process was also using messenger). Can
>> anyone familiar with the 'original' 1.0 JMS client comment on whether the
>> dynamic-node-properties are configurable in any way?
>
> Having a peek at the source, the dynamic node properties aren't
> configurable and are not being set when the 'original' 1.0 JMS client
> creates a temporary destination.

Thanks for confirming!

> The new JMS client sets them with delete-on-close for the lifetime
> policy when creating temporary destinations.

Ok, so one option might be to use that new client. (Caveat, I have not 
tried that out myself and as I've already demonstrated on this thread my 
instincts are not to be trusted).

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Robbie Gemmell <ro...@gmail.com>.
On 5 November 2015 at 11:45, Gordon Sim <gs...@redhat.com> wrote:
> On 11/05/2015 10:32 AM, Michael Ivanov wrote:
>>
>> And it's still the question why the policy is not set for the queue
>> created with:
>>
>>      responseQueue   = session.createTemporaryQueue();
>>
>> when using qpid-amqp-1-0-client-jms-0.30.jar package?
>
>
> That will most likely involve a receiving link with a dynamic source, i.e.
> with no actual source name supplied but the dynamic flag set to true.
>

Essentially, though it actually uses a sending link at the client for
the creator.

> If there was a way to configure the dynamic-node-properties requested in
> this case, then the desired lifetime-policy could be selected. (I had
> incorrectly assumed that the 'S' process was also using messenger). Can
> anyone familiar with the 'original' 1.0 JMS client comment on whether the
> dynamic-node-properties are configurable in any way?

Having a peek at the source, the dynamic node properties aren't
configurable and are not being set when the 'original' 1.0 JMS client
creates a temporary destination.

The new JMS client sets them with delete-on-close for the lifetime
policy when creating temporary destinations.

>
> Just to wrap up, from JMS to trigger a queue created by a matching queue
> policy, you would simply create a message consumer, not a temporary queue.
> These are two different ways of dynamically creating queues, the policy
> based on being a broker specific option.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Gordon Sim <gs...@redhat.com>.
On 11/05/2015 10:32 AM, Michael Ivanov wrote:
> And it's still the question why the policy is not set for the queue created with:
>
>      responseQueue   = session.createTemporaryQueue();
>
> when using qpid-amqp-1-0-client-jms-0.30.jar package?

That will most likely involve a receiving link with a dynamic source, 
i.e. with no actual source name supplied but the dynamic flag set to true.

If there was a way to configure the dynamic-node-properties requested in 
this case, then the desired lifetime-policy could be selected. (I had 
incorrectly assumed that the 'S' process was also using messenger). Can 
anyone familiar with the 'original' 1.0 JMS client comment on whether 
the dynamic-node-properties are configurable in any way?

Just to wrap up, from JMS to trigger a queue created by a matching queue 
policy, you would simply create a message consumer, not a temporary 
queue. These are two different ways of dynamically creating queues, the 
policy based on being a broker specific option.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Michael Ivanov <iv...@isle.spb.ru>.
And it's still the question why the policy is not set for the queue created with:

    responseQueue   = session.createTemporaryQueue();

when using qpid-amqp-1-0-client-jms-0.30.jar package?
If I delete the queue created from java manually and then use the same queue name
with recv test utility the policy is set properly.

05.11.2015 13:27, Gordon Sim пишет:
> On 11/05/2015 10:14 AM, Michael Ivanov wrote:
>> Ok it worked! Probably last time when running recv I mistyped the queue name.
>> But weherever I run recv with such name queue is created and when the recv stopped
>> the queue was automatically deleted. But! It is also deleted when the send utility
>> terminated!
> 
> You are right, I'm sorry. For delete-on-close, the link that trigger the creation needs to be registered as the controlling
> link. This is only done when using the dynamic flag in the source at present. So after a single message, the queue gets deleted.
> 
> Sorry for taking up your time with an incomplete fix! It would take a slightly more involved patch for the idea to work properly.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 


-- 
 \   / |			           |
 (OvO) |  Михаил Иванов                    |
 (^^^) |      Тел.:    +7(911) 223-1300    |
  \^/  |      E-mail:  ivans@isle.spb.ru   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Michael Ivanov <iv...@logit-ag.de>.
Thanks a lot for the patch! But it looks like qpid-jms v 0.6.0 works as expected
without policy settings altogether. We were using v 0.30 all the time (and later
tried 0.32) and the queues were left over. But as soon as we switched to 0.6.0
the problem dissappeared.

Just in case similar problem will appear in non-java ccommunication I'll still
apply the patch and use customized 0.34 version.

Many thanks,

06.11.2015 23:48, Gordon Sim пишет:
> On 11/05/2015 10:28 AM, Michael Ivanov wrote:
>> Is there a chance to get it working for 0.34 in foreseeable future? :-)
> 
> I have committed a fix to trunk (QPID-6834), also attached as another patch.
> 
> Also, I have committed support for ANONYMOUS_RELAY, which I think would provide another workaround. You would need to set a
> 'route' on messenger, see doc for pn_messenger_route, but that would then avoid having a link directly to the queue.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 


-- 
 \   / |			           |
 (OvO) |  Mikhail Iwanow                   |
 (^^^) |      Voice:   +7 (911) 223-1300   |
  \^/  |      E-mail:  ivans@logit-ag.de   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Gordon Sim <gs...@redhat.com>.
On 11/05/2015 10:28 AM, Michael Ivanov wrote:
> Is there a chance to get it working for 0.34 in foreseeable future? :-)

I have committed a fix to trunk (QPID-6834), also attached as another patch.

Also, I have committed support for ANONYMOUS_RELAY, which I think would 
provide another workaround. You would need to set a 'route' on 
messenger, see doc for pn_messenger_route, but that would then avoid 
having a link directly to the queue.


Re: Autodelete queues not deleted

Posted by Michael Ivanov <iv...@logit-ag.de>.
Is there a chance to get it working for 0.34 in foreseeable future? :-)

05.11.2015 13:27, Gordon Sim пишет:
> On 11/05/2015 10:14 AM, Michael Ivanov wrote:
>> Ok it worked! Probably last time when running recv I mistyped the queue name.
>> But weherever I run recv with such name queue is created and when the recv stopped
>> the queue was automatically deleted. But! It is also deleted when the send utility
>> terminated!
> 
> You are right, I'm sorry. For delete-on-close, the link that trigger the creation needs to be registered as the controlling
> link. This is only done when using the dynamic flag in the source at present. So after a single message, the queue gets deleted.
> 
> Sorry for taking up your time with an incomplete fix! It would take a slightly more involved patch for the idea to work properly.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 


-- 
 \   / |			           |
 (OvO) |  Mikhail Iwanow                   |
 (^^^) |                                   |
  \^/  |      E-mail:  ivans@logit-ag.de   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Gordon Sim <gs...@redhat.com>.
On 11/05/2015 10:14 AM, Michael Ivanov wrote:
> Ok it worked! Probably last time when running recv I mistyped the queue name.
> But weherever I run recv with such name queue is created and when the recv stopped
> the queue was automatically deleted. But! It is also deleted when the send utility
> terminated!

You are right, I'm sorry. For delete-on-close, the link that trigger the 
creation needs to be registered as the controlling link. This is only 
done when using the dynamic flag in the source at present. So after a 
single message, the queue gets deleted.

Sorry for taking up your time with an incomplete fix! It would take a 
slightly more involved patch for the idea to work properly.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Michael Ivanov <iv...@isle.spb.ru>.
Ok it worked! Probably last time when running recv I mistyped the queue name.
But weherever I run recv with such name queue is created and when the recv stopped
the queue was automatically deleted. But! It is also deleted when the send utility
terminated! So the receiver gets only one message. All other messages are lost.

But anyway, now I need to figure out why this does not happen with java.

Best regards,

05.11.2015 12:54, Gordon Sim пишет:
> On 11/05/2015 09:38 AM, Michael Ivanov wrote:
>> Do you mean recv example utility from proton?
> 
> Yes
> 
>> I tried it but it does not create the receive queue automatically
> 
> So if you run (with localhost replaced by the actual hostname if necessary, and the exact details of the uuid part not important):
> 
>> ./examples/c/messenger/recv localhost/test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e
> 
> no queue is created? Does recv exit with an error? Are there any errors on the broker?
> 
>> Should I create one manually?
> 
> No, the point of the queue policy is that any attempt to create a link from a source that doesn't exist but matches the policy,
> will have the source created automatically by the broker.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 


-- 
 \   / |			           |
 (OvO) |  Михаил Иванов                    |
 (^^^) |      Тел.:    +7(911) 223-1300    |
  \^/  |      E-mail:  ivans@isle.spb.ru   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Gordon Sim <gs...@redhat.com>.
On 11/05/2015 09:38 AM, Michael Ivanov wrote:
> Do you mean recv example utility from proton?

Yes

> I tried it but it does not create the receive queue automatically

So if you run (with localhost replaced by the actual hostname if 
necessary, and the exact details of the uuid part not important):

> ./examples/c/messenger/recv localhost/test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e

no queue is created? Does recv exit with an error? Are there any errors 
on the broker?

> Should I create one manually?

No, the point of the queue policy is that any attempt to create a link 
from a source that doesn't exist but matches the policy, will have the 
source created automatically by the broker.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Michael Ivanov <iv...@logit-ag.de>.
Do you mean recv example utility from proton?
I tried it but it does not create the receive queue automatically
Should I create one manually?
I tried (qpid-config add queue test2_tempSender12345) and qpid-config queues
output is still without delete-on-close policy.

05.11.2015 12:21, Gordon Sim пишет:
> On 11/04/2015 09:37 PM, Michael Ivanov wrote:
>> Currently it shows:
>>
>> qpid-config list QueuePolicy
>> Objects of type 'QueuePolicy'
>>    name                properties
>>    ===================================================================
>>    test2_tempSender    {u'qpid.lifetime-policy': u'delete-on-close'}
>>    test2_tempSender*   {u'qpid.lifetime-policy': u'delete-on-close'}
>>    test2_tempSender.*  {u'qpid.lifetime-policy': u'delete-on-close'}
> 
> Ok, so the policy has the attribute. Can you try now running the recv example for messenger with an address matching that
> prefix, and the run `qpid-config queues` again? (check if there are any warnings logged by the broker)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 


-- 
 \   / |			           |
 (OvO) |  Mikhail Iwanow                   |
 (^^^) |                                   |
  \^/  |      E-mail:  ivans@logit-ag.de   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Gordon Sim <gs...@redhat.com>.
On 11/04/2015 09:37 PM, Michael Ivanov wrote:
> Currently it shows:
>
> qpid-config list QueuePolicy
> Objects of type 'QueuePolicy'
>    name                properties
>    ===================================================================
>    test2_tempSender    {u'qpid.lifetime-policy': u'delete-on-close'}
>    test2_tempSender*   {u'qpid.lifetime-policy': u'delete-on-close'}
>    test2_tempSender.*  {u'qpid.lifetime-policy': u'delete-on-close'}

Ok, so the policy has the attribute. Can you try now running the recv 
example for messenger with an address matching that prefix, and the run 
`qpid-config queues` again? (check if there are any warnings logged by 
the broker)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Michael Ivanov <iv...@logit-ag.de>.
Currently it shows:

qpid-config list QueuePolicy
Objects of type 'QueuePolicy'
  name                properties
  ===================================================================
  test2_tempSender    {u'qpid.lifetime-policy': u'delete-on-close'}
  test2_tempSender*   {u'qpid.lifetime-policy': u'delete-on-close'}
  test2_tempSender.*  {u'qpid.lifetime-policy': u'delete-on-close'}

05.11.2015 00:34, Gordon Sim пишет:
> On 11/04/2015 09:24 PM, Michael Ivanov wrote:
>> Strange.
>>
>> I just ran qpid-config QueuePolicy again.
>> It gives the following error:
>>
>> qpid-config add QueuePolicy test2_tempSender --argument qpid.lifetime-policy=delete-on-close
>> Failed: Exception: Exception from Agent: {u'error_code': 7, u'error_text': 'An object of type QueuePolicy with key
>> test2_tempSender already exists (/home/ksmgr/rpmbuild/BUILD/qpid-cpp-0.34/src/qpid/broker/amqp/NodePolicy.cpp:283)'}
> 
> What does `qpid-config list QueuePolicy` show?
> 
>> So property seems to be there. Maybe 0.34 does not handle this property right?
> 
> With the patch applied it should. (Without that the delete-on-close value is not recognised).
> 
>> Or is it possible that this property is somehow overridden by jms client
>> (org.apache.qpid.amqp_1_0.jms is used to create the queue)?
> 
> All you need to do is create a consumer for the specified address. I.e. in AMQP terms, you just need to attach a receiving link
> whose source is a unique string starting with test2_tempSender (or whatever you choose as the pattern).
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 


-- 
 \   / |			           |
 (OvO) |  Mikhail Iwanow                   |
 (^^^) |                                   |
  \^/  |      E-mail:  ivans@logit-ag.de   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Gordon Sim <gs...@redhat.com>.
On 11/04/2015 09:24 PM, Michael Ivanov wrote:
> Strange.
>
> I just ran qpid-config QueuePolicy again.
> It gives the following error:
>
> qpid-config add QueuePolicy test2_tempSender --argument qpid.lifetime-policy=delete-on-close
> Failed: Exception: Exception from Agent: {u'error_code': 7, u'error_text': 'An object of type QueuePolicy with key
> test2_tempSender already exists (/home/ksmgr/rpmbuild/BUILD/qpid-cpp-0.34/src/qpid/broker/amqp/NodePolicy.cpp:283)'}

What does `qpid-config list QueuePolicy` show?

> So property seems to be there. Maybe 0.34 does not handle this property right?

With the patch applied it should. (Without that the delete-on-close 
value is not recognised).

> Or is it possible that this property is somehow overridden by jms client
> (org.apache.qpid.amqp_1_0.jms is used to create the queue)?

All you need to do is create a consumer for the specified address. I.e. 
in AMQP terms, you just need to attach a receiving link whose source is 
a unique string starting with test2_tempSender (or whatever you choose 
as the pattern).


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Michael Ivanov <iv...@isle.spb.ru>.
Strange.

I just ran qpid-config QueuePolicy again.
It gives the following error:

qpid-config add QueuePolicy test2_tempSender --argument qpid.lifetime-policy=delete-on-close
Failed: Exception: Exception from Agent: {u'error_code': 7, u'error_text': 'An object of type QueuePolicy with key
test2_tempSender already exists (/home/ksmgr/rpmbuild/BUILD/qpid-cpp-0.34/src/qpid/broker/amqp/NodePolicy.cpp:283)'}

So property seems to be there. Maybe 0.34 does not handle this property right?
Or is it possible that this property is somehow overridden by jms client
(org.apache.qpid.amqp_1_0.jms is used to create the queue)?

Best regards,

05.11.2015 00:12, Gordon Sim пишет:
> On 11/04/2015 08:32 PM, Michael Ivanov wrote:
>> So when I type "qpid-config add QueuePolicy test2_tempSender . . . ." then
>> test2_tempSender is actually interpreted as queue name prefix?
> 
> Yes
> 
>> Here's the output from qpid-config:
>>
>> Queue Name                                             Attributes
>> ===========================================================================
>> 2073D663-550A-4A10-BC3F-425189460809_receiver-10478.0  auto-del
>> XDSMBX                                                 --durable
>> test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e   auto-del
>> test2_tempSender94cfab8c-4478-4e1c-b958-6d128f60f12f   auto-del
> 
> That looks like the policy has not been applied. Here is what I see:
> 
>> $ qpid-config add QueuePolicy test2_tempSender --argument qpid.lifetime-policy=delete-on-close
> 
> then:
> 
>> $ ./examples/c/messenger/recv localhost/test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e
> 
> then:
> 
>> $ qpid-config queues
>> Queue Name                                            Attributes
>> ===========================================================================
>> cece0a35-d616-4264-b151-56e9c2d4c058:0.0              auto-del excl
>> test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e  auto-del --argument qpid.lifetime-policy=delete-on-close
> 
> and if I then start a process that has attaches a sender it can send messages to the recv, but when I kill the recv, the queue
> disappears even though the sender remains attached.
> 
> (I used `./src/tests/qpid-send --content-stdin  --connection-options '{protocol:amqp1.0}' --address
> test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e`)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 


-- 
 \   / |			           |
 (OvO) |  Михаил Иванов                    |
 (^^^) |      Тел.:    +7(911) 223-1300    |
  \^/  |      E-mail:  ivans@isle.spb.ru   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Gordon Sim <gs...@redhat.com>.
On 11/04/2015 08:32 PM, Michael Ivanov wrote:
> So when I type "qpid-config add QueuePolicy test2_tempSender . . . ." then
> test2_tempSender is actually interpreted as queue name prefix?

Yes

> Here's the output from qpid-config:
>
> Queue Name                                             Attributes
> ===========================================================================
> 2073D663-550A-4A10-BC3F-425189460809_receiver-10478.0  auto-del
> XDSMBX                                                 --durable
> test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e   auto-del
> test2_tempSender94cfab8c-4478-4e1c-b958-6d128f60f12f   auto-del

That looks like the policy has not been applied. Here is what I see:

> $ qpid-config add QueuePolicy test2_tempSender --argument qpid.lifetime-policy=delete-on-close

then:

> $ ./examples/c/messenger/recv localhost/test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e

then:

> $ qpid-config queues
> Queue Name                                            Attributes
> ===========================================================================
> cece0a35-d616-4264-b151-56e9c2d4c058:0.0              auto-del excl
> test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e  auto-del --argument qpid.lifetime-policy=delete-on-close

and if I then start a process that has attaches a sender it can send 
messages to the recv, but when I kill the recv, the queue disappears 
even though the sender remains attached.

(I used `./src/tests/qpid-send --content-stdin  --connection-options 
'{protocol:amqp1.0}' --address 
test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e`)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Michael Ivanov <iv...@logit-ag.de>.
So when I type "qpid-config add QueuePolicy test2_tempSender . . . ." then
test2_tempSender is actually interpreted as queue name prefix?

Here's the output from qpid-config:

Queue Name                                             Attributes
===========================================================================
2073D663-550A-4A10-BC3F-425189460809_receiver-10478.0  auto-del
XDSMBX                                                 --durable
test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e   auto-del
test2_tempSender94cfab8c-4478-4e1c-b958-6d128f60f12f   auto-del

qpid-stat -q gives more detailed information:

  queue                                                  dur  autoDel  excl  msg   msgIn  msgOut   cons  bind
  ===========================================================================================================
  2073D663-550A-4A10-BC3F-425189460809_receiver-10478.0       Y                 0     0      0        1     1
  XDSMBX                                                 Y                      0     0      0        1     1
  test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e        Y                 0     1      1        0     1
  test2_tempSender94cfab8c-4478-4e1c-b958-6d128f60f12f        Y                 0     1      1        0     1

Is there any way to check the policy settings for the queue?

Best regards,

04.11.2015 22:51, Gordon Sim пишет:
> On 11/04/2015 07:31 PM, Michael Ivanov wrote:
>> Thanks for the fix suggestions!
>>
>> I have applied your patch to qpidd 0.34 and replaced libqpidbroker.so.2.0.0
>> on test system. I restarted qpidd and verified that no error messages are
>> generated for qpid-config add QueuePolicy command (there were errors with
>> original version). Then I repeated my tests and the queues were still not
>> deleted. Since the queues are created usin uuid, then I need to set queue
>> policy for a queue pattern I guess? My reply queue names look like:
>>
>>     test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e
>>
>> I tried to set queue policy for test2_tempSender, for test2_tempSender*
>> and for test2_tempSender.* In all cases the queues werre not deleted.
>>
>> Am I doing sthing wrong or this is not possible with queue policy in 0.34?
> 
> No, that should work... just to verify, you are first subscribing to test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e, then
> when the subscribing process ends the queue is not being deleted?
> 
> If you do `qpid-config queues` what do you see?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 


-- 
 \   / |			           |
 (OvO) |  Mikhail Iwanow                   |
 (^^^) |      Voice:   +7 (911) 223-1300   |
  \^/  |      E-mail:  ivans@logit-ag.de   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Gordon Sim <gs...@redhat.com>.
On 11/04/2015 07:31 PM, Michael Ivanov wrote:
> Thanks for the fix suggestions!
>
> I have applied your patch to qpidd 0.34 and replaced libqpidbroker.so.2.0.0
> on test system. I restarted qpidd and verified that no error messages are
> generated for qpid-config add QueuePolicy command (there were errors with
> original version). Then I repeated my tests and the queues were still not
> deleted. Since the queues are created usin uuid, then I need to set queue
> policy for a queue pattern I guess? My reply queue names look like:
>
>     test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e
>
> I tried to set queue policy for test2_tempSender, for test2_tempSender*
> and for test2_tempSender.* In all cases the queues werre not deleted.
>
> Am I doing sthing wrong or this is not possible with queue policy in 0.34?

No, that should work... just to verify, you are first subscribing to 
test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e, then when the 
subscribing process ends the queue is not being deleted?

If you do `qpid-config queues` what do you see?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Michael Ivanov <iv...@logit-ag.de>.
Thanks for the fix suggestions!

I have applied your patch to qpidd 0.34 and replaced libqpidbroker.so.2.0.0
on test system. I restarted qpidd and verified that no error messages are
generated for qpid-config add QueuePolicy command (there were errors with
original version). Then I repeated my tests and the queues were still not
deleted. Since the queues are created usin uuid, then I need to set queue
policy for a queue pattern I guess? My reply queue names look like:

   test2_tempSender4e978165-d3fa-4b25-b377-73aa1151b40e

I tried to set queue policy for test2_tempSender, for test2_tempSender*
and for test2_tempSender.* In all cases the queues werre not deleted.

Am I doing sthing wrong or this is not possible with queue policy in 0.34?

Best regards,

04.11.2015 13:13, Gordon Sim пишет:
> On 11/03/2015 09:40 PM, Michael Ivanov wrote:
>> Sorry, I just went through qpid-config options, qpidd options and I did not find
>> how one can configure policy for a queue name pattern. Where can I find this information?
> 
> There is some information in the AMQP_1.0 notes alongside the source[1]. So e.g. you would do:
> 
>     qpid-config add QueuePolicy tempq \
>        --argument qpid.lifetime-policy=delete-on-close
> 
> *However*, I have to apologise now, because I just tried this and it doesn't at present allow delete-on-close as an option in
> that context (it only accepts it in the dynamic-node-properties). That is easy enough to change and a patch is attached (I can
> commit this if it is likely to be of use). It won't work against 0.34 (unless patched) though, sorry for the misinformation.
> 
> The only other workaround I can think of at present would be to have a cleaner process that periodically checked for queues with
> no consumers and deleted them explicitly.
> 
> To my way of thinking, having messenger keep a growing number of links open though they will never again be used, is not ideal.
> Fixing that in messenger, though in some ways the ideal solution, is likely to be a little involved.
> 
> I'm planning to add support for so called 'ANONYMOUS-RELAY' to qpidd. This would allow creating a single sender link with no
> target, and having qpidd route the messages based on the to field in the properties. You would then configure messenger to use
> this for the specified addresses (not 100% sure how to do that, but I believe it is possible). This would mean that there was no
> active link to the queues themselves, allowing them to be deleted when the receiver closes. It would also mean you wouldn't have
> the growing set of links in the 'R' process. I'd hope to have this completed this week, or early next week at latest.
> 
> [1] https://svn.apache.org/repos/asf/qpid/trunk/qpid/cpp/AMQP_1.0
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 


-- 
 \   / |			           |
 (OvO) |  Mikhail Iwanow                   |
 (^^^) |                                   |
  \^/  |      E-mail:  ivans@logit-ag.de   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Gordon Sim <gs...@redhat.com>.
On 11/03/2015 09:40 PM, Michael Ivanov wrote:
> Sorry, I just went through qpid-config options, qpidd options and I did not find
> how one can configure policy for a queue name pattern. Where can I find this information?

There is some information in the AMQP_1.0 notes alongside the source[1]. 
So e.g. you would do:

     qpid-config add QueuePolicy tempq \
        --argument qpid.lifetime-policy=delete-on-close

*However*, I have to apologise now, because I just tried this and it 
doesn't at present allow delete-on-close as an option in that context 
(it only accepts it in the dynamic-node-properties). That is easy enough 
to change and a patch is attached (I can commit this if it is likely to 
be of use). It won't work against 0.34 (unless patched) though, sorry 
for the misinformation.

The only other workaround I can think of at present would be to have a 
cleaner process that periodically checked for queues with no consumers 
and deleted them explicitly.

To my way of thinking, having messenger keep a growing number of links 
open though they will never again be used, is not ideal. Fixing that in 
messenger, though in some ways the ideal solution, is likely to be a 
little involved.

I'm planning to add support for so called 'ANONYMOUS-RELAY' to qpidd. 
This would allow creating a single sender link with no target, and 
having qpidd route the messages based on the to field in the properties. 
You would then configure messenger to use this for the specified 
addresses (not 100% sure how to do that, but I believe it is possible). 
This would mean that there was no active link to the queues themselves, 
allowing them to be deleted when the receiver closes. It would also mean 
you wouldn't have the growing set of links in the 'R' process. I'd hope 
to have this completed this week, or early next week at latest.

[1] https://svn.apache.org/repos/asf/qpid/trunk/qpid/cpp/AMQP_1.0


Re: Autodelete queues not deleted

Posted by Michael Ivanov <iv...@logit-ag.de>.
03.11.2015 23:51, Gordon Sim пишет:
> On 11/03/2015 08:25 PM, Michael Ivanov wrote:
>> I use c++ qpid broker 0.34 and proton library v 0.10. I am using 2 processes:
>> receiver process (R) which reads the messages and sends replies when requested
>> and sender (S) process which creates temporary queues, sends messages to R and
>> requests a reply. Process S does nor run permanently, but process R does.
>> The reply queues dissappear only when process R terminates. When process S runs
>> its reply queue has connections value set to 1, when it terminates connections
>> become 0.
> 
> When the queue is deleted is controlled by the 'lifetime-policy', with all four standard policies defined in the AMQP 1.0
> specification supported. The default is 'delete-on-no-links' in AMQP 1.0 terms.
> 
> Unfortunately messenger doesn't ever close links it has created. So in your case process R will create sender links for every
> unique reply address and never close these. That is something of problem in itself, since over time the number of links would
> just keep growing. Of more immediate concern is that the active link keeps the queue live as well.
> 
> There is a lifetime-policy 'delete-on-close' which would result in the queue being deleted as soon as the link which created it
> closes, regardless of whether there are any other links to or from it. Unfortunately messenger doesn't give you any way to
> request this through the standard protocol defined mechanism (the dynamic-node-properties field).
> 
> One workaround might be to avoid using the dynamic flag from the client at all. Instead you would setup a queue policy on qpidd
> such that all queues created with the name starting e.g. tempq, would have a policy specifying delete-on-close. In the client
> you would then need to generate a unique name yourself using e.g. a uuid appended to the tempq prefix, and use that as the basis
> of the address.

Sorry, I just went through qpid-config options, qpidd options and I did not find
how one can configure policy for a queue name pattern. Where can I find this information?

Best regards,
-- 
 \   / |			           |
 (OvO) |  Mikhail Iwanow                   |
 (^^^) |      Voice:   +7 (911) 223-1300   |
  \^/  |      E-mail:  ivans@logit-ag.de   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Gordon Sim <gs...@redhat.com>.
On 11/03/2015 08:25 PM, Michael Ivanov wrote:
> I use c++ qpid broker 0.34 and proton library v 0.10. I am using 2 processes:
> receiver process (R) which reads the messages and sends replies when requested
> and sender (S) process which creates temporary queues, sends messages to R and
> requests a reply. Process S does nor run permanently, but process R does.
> The reply queues dissappear only when process R terminates. When process S runs
> its reply queue has connections value set to 1, when it terminates connections
> become 0.

When the queue is deleted is controlled by the 'lifetime-policy', with 
all four standard policies defined in the AMQP 1.0 specification 
supported. The default is 'delete-on-no-links' in AMQP 1.0 terms.

Unfortunately messenger doesn't ever close links it has created. So in 
your case process R will create sender links for every unique reply 
address and never close these. That is something of problem in itself, 
since over time the number of links would just keep growing. Of more 
immediate concern is that the active link keeps the queue live as well.

There is a lifetime-policy 'delete-on-close' which would result in the 
queue being deleted as soon as the link which created it closes, 
regardless of whether there are any other links to or from it. 
Unfortunately messenger doesn't give you any way to request this through 
the standard protocol defined mechanism (the dynamic-node-properties field).

One workaround might be to avoid using the dynamic flag from the client 
at all. Instead you would setup a queue policy on qpidd such that all 
queues created with the name starting e.g. tempq, would have a policy 
specifying delete-on-close. In the client you would then need to 
generate a unique name yourself using e.g. a uuid appended to the tempq 
prefix, and use that as the basis of the address.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Michael Ivanov <iv...@logit-ag.de>.
Hallo Gordon, thanks for the response,

I use c++ qpid broker 0.34 and proton library v 0.10. I am using 2 processes:
receiver process (R) which reads the messages and sends replies when requested
and sender (S) process which creates temporary queues, sends messages to R and
requests a reply. Process S does nor run permanently, but process R does.
The reply queues dissappear only when process R terminates. When process S runs
its reply queue has connections value set to 1, when it terminates connections
become 0.

03.11.2015 21:19, Gordon Sim пишет:
> On 11/03/2015 05:57 PM, Michael Ivanov wrote:
>> Hallo,
>>
>> Please help me to resolve the following situation:
>>
>> I create a temporary queue using "/#" suffix to amqp url. The queue is created
>> with name like 36275A5C-8630-457B-BD75-3664354ECC2D_#
>>
>> I set this queue as reply_to address in messages being sent. I receive the reply
>> message and run pn_messenger_accept() for it (I use CUMULATIVE flag just in case).
>> When I check this queue using qpid-stat -q I see that the queue has autoDel flag
>> set. When the queue was just created but not used, then everything is fine, the
>> queue is deleted when it's owning process exits. But as soon as the queue is used
>> to send a reply for at least one message then it is not deleted when owner process
>> is terminated. It still hangs there with bind == 1 and connections set to 0.
>>
>> It can be deleted with qpid-config del queue, but without any explicit action it
>> stays there until the process that has sent a reply, terminates. It is not reused.
>>
>> Can this be fixed and how can I investigate it further?
> 
> What version of the broker are you using? Is the sender process still up?
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 

Best regards,
-- 
 \   / |			           |
 (OvO) |  Mikhail Iwanow                   |
 (^^^) |                                   |
  \^/  |      E-mail:  ivans@logit-ag.de   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: Autodelete queues not deleted

Posted by Gordon Sim <gs...@redhat.com>.
On 11/03/2015 05:57 PM, Michael Ivanov wrote:
> Hallo,
>
> Please help me to resolve the following situation:
>
> I create a temporary queue using "/#" suffix to amqp url. The queue is created
> with name like 36275A5C-8630-457B-BD75-3664354ECC2D_#
>
> I set this queue as reply_to address in messages being sent. I receive the reply
> message and run pn_messenger_accept() for it (I use CUMULATIVE flag just in case).
> When I check this queue using qpid-stat -q I see that the queue has autoDel flag
> set. When the queue was just created but not used, then everything is fine, the
> queue is deleted when it's owning process exits. But as soon as the queue is used
> to send a reply for at least one message then it is not deleted when owner process
> is terminated. It still hangs there with bind == 1 and connections set to 0.
>
> It can be deleted with qpid-config del queue, but without any explicit action it
> stays there until the process that has sent a reply, terminates. It is not reused.
>
> Can this be fixed and how can I investigate it further?

What version of the broker are you using? Is the sender process still up?



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org