You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Rajesh Khan <ra...@gmail.com> on 2013/08/28 22:53:14 UTC

Clearing up queues in C++

I wanted to know what my options are when I need to clear up queues.
My first preference would be to clear them up programatically. I tried
setting a queue to auto-delete however that does not seem to work.I have a
sender and a receiver. The receiver creates a queue and sets the auto
delete parameter. However even after the receiver disconnects there still
is content in the queue. Is there any way of forcefully emptying a queue
using a command prompt ?

Re: Clearing up queues in C++

Posted by Gordon Sim <gs...@redhat.com>.
On 08/28/2013 09:53 PM, Rajesh Khan wrote:
> I wanted to know what my options are when I need to clear up queues.
> My first preference would be to clear them up programatically. I tried
> setting a queue to auto-delete however that does not seem to work.I have a
> sender and a receiver. The receiver creates a queue and sets the auto
> delete parameter. However even after the receiver disconnects there still
> is content in the queue.

Can you give more detail on the exact steps you took here? The 
auto-delete setting should certainly work. Note that if the queue is 
also exclusive then it will be auto-deleted when the session that 
created it ends (not just on cancelling the receiver. Note also that 
trying to set the auto-delete property on a queue already created won't 
work.

If you can provide some steps to reproduce the non-functioning of 
auto-delete, I can investigate some more.


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


Re: Clearing up queues in C++

Posted by Gordon Sim <gs...@redhat.com>.
On 08/28/2013 11:50 PM, Rajesh Khan wrote:
> Thanks that seems to do the trick. Any idea how I could do it
> programatically .


Attached is a simple example program. However I would advise 
investigating the autodelete issue a little more as I'm fairly confident 
it will do as expected if used in the right manner.


Re: Clearing up queues in C++

Posted by Rajesh Khan <ra...@gmail.com>.
While attempting to try this on the actual platform. I do not see the name
of the queue i want to empty using
qpid: list queue
Any idea on why it might be missing?



On Wed, Aug 28, 2013 at 4:50 PM, Rajesh Khan <ra...@gmail.com>wrote:

> Thanks that seems to do the trick. Any idea how I could do it
> programatically . The Programming in APACHE QPID does not have any
> information regarding purge in C++ . Any suggestions ?
>
>
> On Wed, Aug 28, 2013 at 3:32 PM, Chuck Rolke <cr...@redhat.com> wrote:
>
>> OK, how do you do it? Using qpid-tool you can:
>>
>> 1. connect to host
>>
>> qpid-tool localhost:5672
>> qpid:
>>
>> 2. wait while qpid-tool loads everything
>>    then list queues:
>>
>> qpid: list queue
>> Object Summary:
>>     ID   Created   Destroyed  Index
>>
>> ================================================================================
>>     128  21:24:47  -
>>  org.apache.qpid.broker:queue:topic-fjeld.1940.1
>>     124  21:24:47  -
>>  org.apache.qpid.broker:queue:qmfc-v2-fjeld.1940.1
>>     125  21:24:47  -
>>  org.apache.qpid.broker:queue:qmfc-v2-hb-fjeld.1940.1
>>     126  21:24:47  -
>>  org.apache.qpid.broker:queue:qmfc-v2-ui-fjeld.1940.1
>>     127  21:24:47  -
>>  org.apache.qpid.broker:queue:reply-fjeld.1940.1
>>
>> 3. Issue a purge command to one of the queues. Give it a request=0 and an
>> empty filter={}
>>
>> qpid: call 128 purge 0 {}
>> qpid: OK (0) - {}
>>
>> You can get the management method list for any object class by using the
>> 'schema' command:
>>
>> qpid: schema queue
>>
>> -Chuck
>>
>>
>> ----- Original Message -----
>> > From: "Chuck Rolke" <cr...@redhat.com>
>> > To: users@qpid.apache.org
>> > Sent: Wednesday, August 28, 2013 5:19:01 PM
>> > Subject: Re: Clearing up queues in C++
>> >
>> > Queues have a purge management method that you can call from a command
>> line
>> > utility or from within your code.
>> >
>> >   Method: purge
>> >     Argument  Type         Direction  Unit  Description
>> >
>> ======================================================================================================
>> >     request   uint32       I                0 for all messages or n>0
>> for n
>> >     messages
>> >     filter    field-table  I                if specified, purge only
>> those
>> >     messages matching this filter
>> >
>> > -Chuck
>> >
>> > ----- Original Message -----
>> > > From: "Rajesh Khan" <ra...@gmail.com>
>> > > To: users@qpid.apache.org
>> > > Sent: Wednesday, August 28, 2013 4:53:14 PM
>> > > Subject: Clearing up queues in C++
>> > >
>> > > I wanted to know what my options are when I need to clear up queues.
>> > > My first preference would be to clear them up programatically. I tried
>> > > setting a queue to auto-delete however that does not seem to work.I
>> have a
>> > > sender and a receiver. The receiver creates a queue and sets the auto
>> > > delete parameter. However even after the receiver disconnects there
>> still
>> > > is content in the queue. Is there any way of forcefully emptying a
>> queue
>> > > using a command prompt ?
>> > >
>> >
>> > ---------------------------------------------------------------------
>> > 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: Clearing up queues in C++

Posted by Rajesh Khan <ra...@gmail.com>.
Thanks that seems to do the trick. Any idea how I could do it
programatically . The Programming in APACHE QPID does not have any
information regarding purge in C++ . Any suggestions ?


On Wed, Aug 28, 2013 at 3:32 PM, Chuck Rolke <cr...@redhat.com> wrote:

> OK, how do you do it? Using qpid-tool you can:
>
> 1. connect to host
>
> qpid-tool localhost:5672
> qpid:
>
> 2. wait while qpid-tool loads everything
>    then list queues:
>
> qpid: list queue
> Object Summary:
>     ID   Created   Destroyed  Index
>
> ================================================================================
>     128  21:24:47  -
>  org.apache.qpid.broker:queue:topic-fjeld.1940.1
>     124  21:24:47  -
>  org.apache.qpid.broker:queue:qmfc-v2-fjeld.1940.1
>     125  21:24:47  -
>  org.apache.qpid.broker:queue:qmfc-v2-hb-fjeld.1940.1
>     126  21:24:47  -
>  org.apache.qpid.broker:queue:qmfc-v2-ui-fjeld.1940.1
>     127  21:24:47  -
>  org.apache.qpid.broker:queue:reply-fjeld.1940.1
>
> 3. Issue a purge command to one of the queues. Give it a request=0 and an
> empty filter={}
>
> qpid: call 128 purge 0 {}
> qpid: OK (0) - {}
>
> You can get the management method list for any object class by using the
> 'schema' command:
>
> qpid: schema queue
>
> -Chuck
>
>
> ----- Original Message -----
> > From: "Chuck Rolke" <cr...@redhat.com>
> > To: users@qpid.apache.org
> > Sent: Wednesday, August 28, 2013 5:19:01 PM
> > Subject: Re: Clearing up queues in C++
> >
> > Queues have a purge management method that you can call from a command
> line
> > utility or from within your code.
> >
> >   Method: purge
> >     Argument  Type         Direction  Unit  Description
> >
> ======================================================================================================
> >     request   uint32       I                0 for all messages or n>0
> for n
> >     messages
> >     filter    field-table  I                if specified, purge only
> those
> >     messages matching this filter
> >
> > -Chuck
> >
> > ----- Original Message -----
> > > From: "Rajesh Khan" <ra...@gmail.com>
> > > To: users@qpid.apache.org
> > > Sent: Wednesday, August 28, 2013 4:53:14 PM
> > > Subject: Clearing up queues in C++
> > >
> > > I wanted to know what my options are when I need to clear up queues.
> > > My first preference would be to clear them up programatically. I tried
> > > setting a queue to auto-delete however that does not seem to work.I
> have a
> > > sender and a receiver. The receiver creates a queue and sets the auto
> > > delete parameter. However even after the receiver disconnects there
> still
> > > is content in the queue. Is there any way of forcefully emptying a
> queue
> > > using a command prompt ?
> > >
> >
> > ---------------------------------------------------------------------
> > 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: Clearing up queues in C++

Posted by Chuck Rolke <cr...@redhat.com>.
OK, how do you do it? Using qpid-tool you can:

1. connect to host

qpid-tool localhost:5672
qpid:

2. wait while qpid-tool loads everything
   then list queues:

qpid: list queue
Object Summary:
    ID   Created   Destroyed  Index
    ================================================================================
    128  21:24:47  -          org.apache.qpid.broker:queue:topic-fjeld.1940.1
    124  21:24:47  -          org.apache.qpid.broker:queue:qmfc-v2-fjeld.1940.1
    125  21:24:47  -          org.apache.qpid.broker:queue:qmfc-v2-hb-fjeld.1940.1
    126  21:24:47  -          org.apache.qpid.broker:queue:qmfc-v2-ui-fjeld.1940.1
    127  21:24:47  -          org.apache.qpid.broker:queue:reply-fjeld.1940.1

3. Issue a purge command to one of the queues. Give it a request=0 and an empty filter={} 

qpid: call 128 purge 0 {}
qpid: OK (0) - {}

You can get the management method list for any object class by using the 'schema' command:

qpid: schema queue

-Chuck


----- Original Message -----
> From: "Chuck Rolke" <cr...@redhat.com>
> To: users@qpid.apache.org
> Sent: Wednesday, August 28, 2013 5:19:01 PM
> Subject: Re: Clearing up queues in C++
> 
> Queues have a purge management method that you can call from a command line
> utility or from within your code.
> 
>   Method: purge
>     Argument  Type         Direction  Unit  Description
>     ======================================================================================================
>     request   uint32       I                0 for all messages or n>0 for n
>     messages
>     filter    field-table  I                if specified, purge only those
>     messages matching this filter
> 
> -Chuck
> 
> ----- Original Message -----
> > From: "Rajesh Khan" <ra...@gmail.com>
> > To: users@qpid.apache.org
> > Sent: Wednesday, August 28, 2013 4:53:14 PM
> > Subject: Clearing up queues in C++
> > 
> > I wanted to know what my options are when I need to clear up queues.
> > My first preference would be to clear them up programatically. I tried
> > setting a queue to auto-delete however that does not seem to work.I have a
> > sender and a receiver. The receiver creates a queue and sets the auto
> > delete parameter. However even after the receiver disconnects there still
> > is content in the queue. Is there any way of forcefully emptying a queue
> > using a command prompt ?
> > 
> 
> ---------------------------------------------------------------------
> 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: Clearing up queues in C++

Posted by Chuck Rolke <cr...@redhat.com>.
Queues have a purge management method that you can call from a command line utility or from within your code.

  Method: purge
    Argument  Type         Direction  Unit  Description
    ======================================================================================================
    request   uint32       I                0 for all messages or n>0 for n messages
    filter    field-table  I                if specified, purge only those messages matching this filter

-Chuck

----- Original Message -----
> From: "Rajesh Khan" <ra...@gmail.com>
> To: users@qpid.apache.org
> Sent: Wednesday, August 28, 2013 4:53:14 PM
> Subject: Clearing up queues in C++
> 
> I wanted to know what my options are when I need to clear up queues.
> My first preference would be to clear them up programatically. I tried
> setting a queue to auto-delete however that does not seem to work.I have a
> sender and a receiver. The receiver creates a queue and sets the auto
> delete parameter. However even after the receiver disconnects there still
> is content in the queue. Is there any way of forcefully emptying a queue
> using a command prompt ?
> 

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