You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Se...@troika.ru on 2011/02/01 14:34:58 UTC

Delete all the messages from a queue.

Hi there,

Is there any guaranteed way to remove all the messages from a queue?

I'm using MRG 1.3, and I have tried the following way:

qpid-tool 
qpid: list 
qpid: list queue 
qpid: call queue-id purge 0 
quit 

but without success.

Could you please tell where the problem could be? And what to pay 
attention to?


Best Regards,
Sergey Zhemzhitsky
Information Technology Division
Troika Dialog, 4, Romanov lane, Moscow 125009, Russia
Phone. +7 495 2580500 ext. 1246

Re: Delete all the messages from a queue.

Posted by Se...@troika.ru.
Ted, sessions are not transactional.

It seems that the only way is to recreate queue.

Is it possible to get amount of messages or get all the messages by means 
of plain qpid API even if there are transactional sessions?


Best Regards,
Sergey




Ted Ross <tr...@redhat.com> 
01.02.2011 18:27
Please respond to
users@qpid.apache.org


To
users@qpid.apache.org
cc

Subject
Re: Delete all the messages from a queue.






Sergey,

Are you using transactional sessions?

-Ted

On 02/01/2011 10:11 AM, Sergey_Zhemzhitsky@troika.ru wrote:
> Hi Jonathan,
>
> I have tried all the ways to get a valid number of messages but without
> success.
> qpid-stat and qpid-tool return the same number of messages that is not 
0.
> If I try to browse the queue by means of HermesJMS there are no messages
> in the queue.
>
>
> Best Regards,
> Sergey Zhemzhitsky
>
>
>
>
> Jonathan Robie<jo...@redhat.com>
> 01.02.2011 17:56
> Please respond to
> users@qpid.apache.org
>
>
> To
> users@qpid.apache.org
> cc
>
> Subject
> Re: Delete all the messages from a queue.
>
>
>
>
>
>
> On 02/01/2011 09:19 AM, Sergey_Zhemzhitsky@troika.ru wrote:
>> Well, queue seems to be empty, because I can't read a message from it.
>>
>> Does anybody know how make qpid-tool and qpid-stat return an 
appropriate
>> information?
> 1. qpid-stat -q gives statistics for a queue
>
> 2. In qpid-tool, first do a 'list queue' to get the OID of the queue,
> then do a 'show<OID>'. The property 'msgDepth' tells you how many
> messages are on the queue. See screen output below my signature.
>
> Jonathan
>
>
>
> qpid: list queue
> Object Summary:
>       ID   Created   Destroyed  Index
> ========================================================================
>       123  14:33:09  - 135.qmfc-v2-hb-localhost.localdomain.16162.1
>       124  14:33:09  - 135.qmfc-v2-localhost.localdomain.16162.1
>       125  14:33:09  - 135.qmfc-v2-ui-localhost.localdomain.16162.1
>       126  14:33:09  -          135.reply-localhost.localdomain.16162.1
>       127  14:33:09  -          135.topic-localhost.localdomain.16162.1
>
>
>
> qpid: show 123
> Object of type:
> org.apache.qpid.broker:queue:_data(3a30c319-5ef2-f211-ba1f-4900d5f75435)
>       Attribute              123
>       =================================================================
>       vhostRef               135
>       name                   qmfc-v2-hb-localhost.localdomain.16162.1
>       durable                False
>       autoDelete             True
>       exclusive              True
>       arguments              {u'qpid.policy_type': u'ring'}
>       altExchange            162
>       msgTotalEnqueues       0
>       msgTotalDequeues       0
>       msgTxnEnqueues         0
>       msgTxnDequeues         0
>       msgPersistEnqueues     0
>       msgPersistDequeues     0
>       msgDepth               0
>
>
> ---------------------------------------------------------------------
> 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



Re: Delete all the messages from a queue.

Posted by Ted Ross <tr...@redhat.com>.
Sergey,

Are you using transactional sessions?

-Ted

On 02/01/2011 10:11 AM, Sergey_Zhemzhitsky@troika.ru wrote:
> Hi Jonathan,
>
> I have tried all the ways to get a valid number of messages but without
> success.
> qpid-stat and qpid-tool return the same number of messages that is not 0.
> If I try to browse the queue by means of HermesJMS there are no messages
> in the queue.
>
>
> Best Regards,
> Sergey Zhemzhitsky
>
>
>
>
> Jonathan Robie<jo...@redhat.com>
> 01.02.2011 17:56
> Please respond to
> users@qpid.apache.org
>
>
> To
> users@qpid.apache.org
> cc
>
> Subject
> Re: Delete all the messages from a queue.
>
>
>
>
>
>
> On 02/01/2011 09:19 AM, Sergey_Zhemzhitsky@troika.ru wrote:
>> Well, queue seems to be empty, because I can't read a message from it.
>>
>> Does anybody know how make qpid-tool and qpid-stat return an appropriate
>> information?
> 1. qpid-stat -q gives statistics for a queue
>
> 2. In qpid-tool, first do a 'list queue' to get the OID of the queue,
> then do a 'show<OID>'. The property 'msgDepth' tells you how many
> messages are on the queue. See screen output below my signature.
>
> Jonathan
>
>
>
> qpid: list queue
> Object Summary:
>       ID   Created   Destroyed  Index
> ========================================================================
>       123  14:33:09  - 135.qmfc-v2-hb-localhost.localdomain.16162.1
>       124  14:33:09  -          135.qmfc-v2-localhost.localdomain.16162.1
>       125  14:33:09  - 135.qmfc-v2-ui-localhost.localdomain.16162.1
>       126  14:33:09  -          135.reply-localhost.localdomain.16162.1
>       127  14:33:09  -          135.topic-localhost.localdomain.16162.1
>
>
>
> qpid: show 123
> Object of type:
> org.apache.qpid.broker:queue:_data(3a30c319-5ef2-f211-ba1f-4900d5f75435)
>       Attribute              123
>       =================================================================
>       vhostRef               135
>       name                   qmfc-v2-hb-localhost.localdomain.16162.1
>       durable                False
>       autoDelete             True
>       exclusive              True
>       arguments              {u'qpid.policy_type': u'ring'}
>       altExchange            162
>       msgTotalEnqueues       0
>       msgTotalDequeues       0
>       msgTxnEnqueues         0
>       msgTxnDequeues         0
>       msgPersistEnqueues     0
>       msgPersistDequeues     0
>       msgDepth               0
>
>
> ---------------------------------------------------------------------
> 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


Re: Delete all the messages from a queue.

Posted by Se...@troika.ru.
Hi Jonathan,

I have tried all the ways to get a valid number of messages but without 
success. 
qpid-stat and qpid-tool return the same number of messages that is not 0. 
If I try to browse the queue by means of HermesJMS there are no messages 
in the queue.


Best Regards,
Sergey Zhemzhitsky




Jonathan Robie <jo...@redhat.com> 
01.02.2011 17:56
Please respond to
users@qpid.apache.org


To
users@qpid.apache.org
cc

Subject
Re: Delete all the messages from a queue.






On 02/01/2011 09:19 AM, Sergey_Zhemzhitsky@troika.ru wrote:
> Well, queue seems to be empty, because I can't read a message from it.
>
> Does anybody know how make qpid-tool and qpid-stat return an appropriate
> information?

1. qpid-stat -q gives statistics for a queue

2. In qpid-tool, first do a 'list queue' to get the OID of the queue, 
then do a 'show <OID>'. The property 'msgDepth' tells you how many 
messages are on the queue. See screen output below my signature.

Jonathan



qpid: list queue
Object Summary:
     ID   Created   Destroyed  Index 
========================================================================
     123  14:33:09  - 135.qmfc-v2-hb-localhost.localdomain.16162.1
     124  14:33:09  -          135.qmfc-v2-localhost.localdomain.16162.1
     125  14:33:09  - 135.qmfc-v2-ui-localhost.localdomain.16162.1
     126  14:33:09  -          135.reply-localhost.localdomain.16162.1
     127  14:33:09  -          135.topic-localhost.localdomain.16162.1



qpid: show 123
Object of type: 
org.apache.qpid.broker:queue:_data(3a30c319-5ef2-f211-ba1f-4900d5f75435)
     Attribute              123
     =================================================================
     vhostRef               135
     name                   qmfc-v2-hb-localhost.localdomain.16162.1
     durable                False
     autoDelete             True
     exclusive              True
     arguments              {u'qpid.policy_type': u'ring'}
     altExchange            162
     msgTotalEnqueues       0
     msgTotalDequeues       0
     msgTxnEnqueues         0
     msgTxnDequeues         0
     msgPersistEnqueues     0
     msgPersistDequeues     0
     msgDepth               0


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



Re: Delete all the messages from a queue.

Posted by Jonathan Robie <jo...@redhat.com>.
On 02/01/2011 09:19 AM, Sergey_Zhemzhitsky@troika.ru wrote:
> Well, queue seems to be empty, because I can't read a message from it.
>
> Does anybody know how make qpid-tool and qpid-stat return an appropriate
> information?

1. qpid-stat -q gives statistics for a queue

2. In qpid-tool, first do a 'list queue' to get the OID of the queue, 
then do a 'show <OID>'. The property 'msgDepth' tells you how many 
messages are on the queue. See screen output below my signature.

Jonathan



qpid: list queue
Object Summary:
     ID   Created   Destroyed  Index 
========================================================================
     123  14:33:09  -          135.qmfc-v2-hb-localhost.localdomain.16162.1
     124  14:33:09  -          135.qmfc-v2-localhost.localdomain.16162.1
     125  14:33:09  -          135.qmfc-v2-ui-localhost.localdomain.16162.1
     126  14:33:09  -          135.reply-localhost.localdomain.16162.1
     127  14:33:09  -          135.topic-localhost.localdomain.16162.1



qpid: show 123
Object of type: 
org.apache.qpid.broker:queue:_data(3a30c319-5ef2-f211-ba1f-4900d5f75435)
     Attribute              123
     =================================================================
     vhostRef               135
     name                   qmfc-v2-hb-localhost.localdomain.16162.1
     durable                False
     autoDelete             True
     exclusive              True
     arguments              {u'qpid.policy_type': u'ring'}
     altExchange            162
     msgTotalEnqueues       0
     msgTotalDequeues       0
     msgTxnEnqueues         0
     msgTxnDequeues         0
     msgPersistEnqueues     0
     msgPersistDequeues     0
     msgDepth               0


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


Re: Delete all the messages from a queue.

Posted by Se...@troika.ru.
It's interesting to know.

I will investigate this issue if I have more time.

Thanks for help.

Best Regards,
Sergey Zhemzhitsky




Ted Ross <tr...@redhat.com> 
02.02.2011 17:02
Please respond to
users@qpid.apache.org


To
users@qpid.apache.org
cc

Subject
Re: Delete all the messages from a queue.






Interesting... those messages must have already been delivered, but not 
completed, to the other subscriber.  That would explain why they didn't 
purge and also why you wouldn't see them when consuming from the queue.

-Ted

On 02/02/2011 05:40 AM, Sergey_Zhemzhitsky@troika.ru wrote:
> The issue was in a remaining subscriber. When I killed it I was able to
> purge my queue.
>
>
> Best Regards,
> Sergey Zhemzhitsky
>
>
>
>
> Sergey_Zhemzhitsky@troika.ru
> 02.02.2011 10:20
> Please respond to
> users@qpid.apache.org
>
>
> To
> users@qpid.apache.org
> cc
>
> Subject
> Re: Delete all the messages from a queue.
>
>
>
>
>
>
> Hi Gordon,
>
> I'm not able to reproduce such a behavior on another environment.
> When I'm trying to execute call<queue_id>  purge 0, the command executes
> successfully and there aren't exceptions in the log file. However "show
> <queue_id>" and "qpid-stat" show that some messages remain.
>
>
> Best Regards,
> Sergey Zhemzhitsky
>
>
>
>
> Gordon Sim<gs...@redhat.com>
> 01.02.2011 18:43
> Please respond to
> users@qpid.apache.org
>
>
> To
> users@qpid.apache.org
> cc
>
> Subject
> Re: Delete all the messages from a queue.
>
>
>
>
>
>
> On 02/01/2011 03:25 PM, Sergey_Zhemzhitsky@troika.ru wrote:
>> Here is the command I have used
>>
>> qpid-config --durable --file-count 128 --file-size 32 add queue MyQueue
> Are you able to repeat the sequence that resulted in that state? Are
> there any errors in the log?
>
> ---------------------------------------------------------------------
> 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



Re: Delete all the messages from a queue.

Posted by Ted Ross <tr...@redhat.com>.
Interesting... those messages must have already been delivered, but not 
completed, to the other subscriber.  That would explain why they didn't 
purge and also why you wouldn't see them when consuming from the queue.

-Ted

On 02/02/2011 05:40 AM, Sergey_Zhemzhitsky@troika.ru wrote:
> The issue was in a remaining subscriber. When I killed it I was able to
> purge my queue.
>
>
> Best Regards,
> Sergey Zhemzhitsky
>
>
>
>
> Sergey_Zhemzhitsky@troika.ru
> 02.02.2011 10:20
> Please respond to
> users@qpid.apache.org
>
>
> To
> users@qpid.apache.org
> cc
>
> Subject
> Re: Delete all the messages from a queue.
>
>
>
>
>
>
> Hi Gordon,
>
> I'm not able to reproduce such a behavior on another environment.
> When I'm trying to execute call<queue_id>  purge 0, the command executes
> successfully and there aren't exceptions in the log file. However "show
> <queue_id>" and "qpid-stat" show that some messages remain.
>
>
> Best Regards,
> Sergey Zhemzhitsky
>
>
>
>
> Gordon Sim<gs...@redhat.com>
> 01.02.2011 18:43
> Please respond to
> users@qpid.apache.org
>
>
> To
> users@qpid.apache.org
> cc
>
> Subject
> Re: Delete all the messages from a queue.
>
>
>
>
>
>
> On 02/01/2011 03:25 PM, Sergey_Zhemzhitsky@troika.ru wrote:
>> Here is the command I have used
>>
>> qpid-config --durable --file-count 128 --file-size 32 add queue MyQueue
> Are you able to repeat the sequence that resulted in that state? Are
> there any errors in the log?
>
> ---------------------------------------------------------------------
> 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


Re: Delete all the messages from a queue.

Posted by Se...@troika.ru.
The issue was in a remaining subscriber. When I killed it I was able to 
purge my queue.


Best Regards,
Sergey Zhemzhitsky




Sergey_Zhemzhitsky@troika.ru 
02.02.2011 10:20
Please respond to
users@qpid.apache.org


To
users@qpid.apache.org
cc

Subject
Re: Delete all the messages from a queue.






Hi Gordon,

I'm not able to reproduce such a behavior on another environment. 
When I'm trying to execute call <queue_id> purge 0, the command executes 
successfully and there aren't exceptions in the log file. However "show 
<queue_id>" and "qpid-stat" show that some messages remain.


Best Regards,
Sergey Zhemzhitsky




Gordon Sim <gs...@redhat.com> 
01.02.2011 18:43
Please respond to
users@qpid.apache.org


To
users@qpid.apache.org
cc

Subject
Re: Delete all the messages from a queue.






On 02/01/2011 03:25 PM, Sergey_Zhemzhitsky@troika.ru wrote:
> Here is the command I have used
>
> qpid-config --durable --file-count 128 --file-size 32 add queue MyQueue

Are you able to repeat the sequence that resulted in that state? Are 
there any errors in the log?

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




Re: Delete all the messages from a queue.

Posted by Se...@troika.ru.
Hi Gordon,

I'm not able to reproduce such a behavior on another environment. 
When I'm trying to execute call <queue_id> purge 0, the command executes 
successfully and there aren't exceptions in the log file. However "show 
<queue_id>" and "qpid-stat" show that some messages remain.


Best Regards,
Sergey Zhemzhitsky




Gordon Sim <gs...@redhat.com> 
01.02.2011 18:43
Please respond to
users@qpid.apache.org


To
users@qpid.apache.org
cc

Subject
Re: Delete all the messages from a queue.






On 02/01/2011 03:25 PM, Sergey_Zhemzhitsky@troika.ru wrote:
> Here is the command I have used
>
> qpid-config --durable --file-count 128 --file-size 32 add queue MyQueue

Are you able to repeat the sequence that resulted in that state? Are 
there any errors in the log?

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



Re: Delete all the messages from a queue.

Posted by Gordon Sim <gs...@redhat.com>.
On 02/01/2011 03:25 PM, Sergey_Zhemzhitsky@troika.ru wrote:
> Here is the command I have used
>
> qpid-config --durable --file-count 128 --file-size 32 add queue MyQueue

Are you able to repeat the sequence that resulted in that state? Are 
there any errors in the log?

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


Re: Delete all the messages from a queue.

Posted by Se...@troika.ru.
Here is the command I have used

qpid-config --durable --file-count 128 --file-size 32 add queue MyQueue


Best Regards,
Sergey Zhemzhitsky




Gordon Sim <gs...@redhat.com> 
01.02.2011 18:13
Please respond to
users@qpid.apache.org


To
users@qpid.apache.org
cc

Subject
Re: Delete all the messages from a queue.






On 02/01/2011 02:19 PM, Sergey_Zhemzhitsky@troika.ru wrote:
> Well, queue seems to be empty, because I can't read a message from it.
>
> Does anybody know how make qpid-tool and qpid-stat return an appropriate
> information?
>
> Here is output of the qpid-stat command
>
> Queues
>    queue                             dur         autoDel         excl 
msg
> msgIn   msgOut          bytes   bytesIn         bytesOut        cons 
bind
>
> 
========================================================================================================================
>    MyQueue                       Y 5
>          5       0               775     775                     0 0
>          2
>
> But actually MyQueue does not contain a message. I can't read from it.

That is indeed strange. Though qpid-tool can take a while to get updated 
stats, qpid-stat should be synchronous. How did you create the queue? 
Does it have any particular config options?

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



Re: Delete all the messages from a queue.

Posted by Gordon Sim <gs...@redhat.com>.
On 02/01/2011 02:19 PM, Sergey_Zhemzhitsky@troika.ru wrote:
> Well, queue seems to be empty, because I can't read a message from it.
>
> Does anybody know how make qpid-tool and qpid-stat return an appropriate
> information?
>
> Here is output of the qpid-stat command
>
> Queues
>    queue                             dur         autoDel         excl msg
> msgIn   msgOut          bytes   bytesIn         bytesOut        cons bind
>
> ========================================================================================================================
>    MyQueue                       Y                                       5
>          5       0               775     775                     0       0
>          2
>
> But actually MyQueue does not contain a message. I can't read from it.

That is indeed strange. Though qpid-tool can take a while to get updated 
stats, qpid-stat should be synchronous. How did you create the queue? 
Does it have any particular config options?

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


Re: Delete all the messages from a queue.

Posted by Se...@troika.ru.
Well, queue seems to be empty, because I can't read a message from it.

Does anybody know how make qpid-tool and qpid-stat return an appropriate 
information?

Here is output of the qpid-stat command

Queues
  queue                             dur         autoDel         excl msg  
msgIn   msgOut          bytes   bytesIn         bytesOut        cons bind
 
========================================================================================================================
  MyQueue                       Y                                       5  
        5       0               775     775                     0       0  
        2

But actually MyQueue does not contain a message. I can't read from it.


Best Regards,
Sergey Zhemzhitsky
Information Technology Division
Troika Dialog, 4, Romanov lane, Moscow 125009, Russia
Phone. +7 495 2580500 ext. 1246



Sergey_Zhemzhitsky@troika.ru 
01.02.2011 16:39
Please respond to
users@qpid.apache.org


To
users@qpid.apache.org
cc

Subject
Delete all the messages from a queue.






Hi there,

Is there any guaranteed way to remove all the messages from a queue?

I'm using MRG 1.3, and I have tried the following way:

qpid-tool 
qpid: list 
qpid: list queue 
qpid: call queue-id purge 0 
quit 

but without success.

Could you please tell where the problem could be? And what to pay 
attention to?


Best Regards,
Sergey Zhemzhitsky
Information Technology Division
Troika Dialog, 4, Romanov lane, Moscow 125009, Russia
Phone. +7 495 2580500 ext. 1246