You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Bill Whiting <te...@bellsouth.net> on 2009/09/09 17:06:13 UTC

browse queue

Is there sample code or explanation in the documentation on how to 
browse a queue.
I have setup a local queue and subscribed to messages from a queue in 
the broker.  I set acquire mode to pre-acquire and the accept mode to none.

The messages are still removed from the broker's queue even though I 
don't accept the message.

What am I doing wrong?

//Bill

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


Re: browse queue

Posted by Bill Whiting <te...@bellsouth.net>.
I changed the acceptMode and now the message dequeues are being reported 
correctly.

Thanks so much!
//Bill

On 09/09/2009 02:19 PM, Gordon Sim wrote:
> On 09/09/2009 06:35 PM, Bill Whiting wrote:
>> There's nothing special about the put program.
>> The browse program browses messages from the queue and will acquire and
>> accept every fourth message.
>>
>> The code works in that if you run the put program 5 times , and then run
>> browse. The first time you run browse there will be 20 messages that are
>> read. The second time the browse will only show 16 messages, although
>> qpid-stat -q will show the queue depth as 20.
>
> There is indeed a bug. If you change the acceptMode to 
> ACCEPT_MODE_EXPLICIT you will see the dequeues reported as expected.
>
> However with ACCEPT_MODE_NONE, the message is not correctly dequeued 
> on being acquired as it should be (the explicit accept in this case 
> would then be ignored). It is removed from the in-memory delivery 
> queue (which is why it doesn't get redelivered to subsequent clients).
>
> I've raised a Jira (https://issues.apache.org/jira/browse/QPID-2089) 
> and will endeavour to get that fixed shortly. Thanks for raising this!
>
>
> ---------------------------------------------------------------------
> 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: browse queue

Posted by Gordon Sim <gs...@redhat.com>.
On 09/09/2009 06:35 PM, Bill Whiting wrote:
> There's nothing special about the put program.
> The browse program browses messages from the queue and will acquire and
> accept every fourth message.
>
> The code works in that if you run the put program 5 times , and then run
> browse. The first time you run browse there will be 20 messages that are
> read. The second time the browse will only show 16 messages, although
> qpid-stat -q will show the queue depth as 20.

There is indeed a bug. If you change the acceptMode to 
ACCEPT_MODE_EXPLICIT you will see the dequeues reported as expected.

However with ACCEPT_MODE_NONE, the message is not correctly dequeued on 
being acquired as it should be (the explicit accept in this case would 
then be ignored). It is removed from the in-memory delivery queue (which 
is why it doesn't get redelivered to subsequent clients).

I've raised a Jira (https://issues.apache.org/jira/browse/QPID-2089) and 
will endeavour to get that fixed shortly. Thanks for raising this!


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


Re: browse queue

Posted by Bill Whiting <te...@bellsouth.net>.
There's nothing special about the put program.
The browse program browses messages from the queue and will acquire and 
accept every fourth message.

The code works in that if you run the put program 5 times , and then run 
browse.  The first time you run browse there will be 20 messages that 
are read.  The second time the browse will only show 16 messages, 
although qpid-stat -q will show the queue depth as 20.

//Bill

On 09/09/2009 01:12 PM, Bill Whiting wrote:
> On 09/09/2009 12:50 PM, Carl Trieloff wrote:
>> Gordon Sim wrote:
>>> On 09/09/2009 04:59 PM, Bill Whiting wrote:
>>>> Thanks, I'm able to browse messages non-destructively and I can
>>>> acquire/accept an individual message and remove it from the queue;
>>>> however, qpid-stat -q shows the same number of messages.
>>>>
>>>> Is this a bug in qpid-stat or are those messages waiting for some
>>>> timeout before they become available again?
>>>
>>> Acquired and accepted messages should be dequeued when the broker 
>>> gets the accept and would then be reflected in the dequeued count 
>>> shown by qpid-stat. 
>>
>> note that stats get updated on mgnt interval for tools that subscribe 
>> to this info like qpid-tool.
>>
>> Carl.
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>
>>
> Increases to queue depth show immediately, decreases in queue depth 
> are not showing at all.
> If I use qpid-tool -> show connection
> It showed the connection for qpid-tool, and the last connection of my 
> test application for several seconds (60+), but now only the current 
> connection shows, however, queue depth has not decreased.
>
> I'll clean up the code and post it.
>
> //Bill
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>


Re: browse queue

Posted by Bill Whiting <te...@bellsouth.net>.
On 09/09/2009 12:50 PM, Carl Trieloff wrote:
> Gordon Sim wrote:
>> On 09/09/2009 04:59 PM, Bill Whiting wrote:
>>> Thanks, I'm able to browse messages non-destructively and I can
>>> acquire/accept an individual message and remove it from the queue;
>>> however, qpid-stat -q shows the same number of messages.
>>>
>>> Is this a bug in qpid-stat or are those messages waiting for some
>>> timeout before they become available again?
>>
>> Acquired and accepted messages should be dequeued when the broker 
>> gets the accept and would then be reflected in the dequeued count 
>> shown by qpid-stat. 
>
> note that stats get updated on mgnt interval for tools that subscribe 
> to this info like qpid-tool.
>
> Carl.
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>
Increases to queue depth show immediately, decreases in queue depth are 
not showing at all.
If I use qpid-tool -> show connection
It showed the connection for qpid-tool, and the last connection of my 
test application for several seconds (60+), but now only the current 
connection shows, however, queue depth has not decreased.

I'll clean up the code and post it.

//Bill

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


Re: browse queue

Posted by Carl Trieloff <cc...@redhat.com>.
Gordon Sim wrote:
> On 09/09/2009 04:59 PM, Bill Whiting wrote:
>> Thanks, I'm able to browse messages non-destructively and I can
>> acquire/accept an individual message and remove it from the queue;
>> however, qpid-stat -q shows the same number of messages.
>>
>> Is this a bug in qpid-stat or are those messages waiting for some
>> timeout before they become available again?
>
> Acquired and accepted messages should be dequeued when the broker gets 
> the accept and would then be reflected in the dequeued count shown by 
> qpid-stat. 

note that stats get updated on mgnt interval for tools that subscribe to 
this info like qpid-tool.

Carl.

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


Re: browse queue

Posted by Gordon Sim <gs...@redhat.com>.
On 09/09/2009 04:59 PM, Bill Whiting wrote:
> Thanks, I'm able to browse messages non-destructively and I can
> acquire/accept an individual message and remove it from the queue;
> however, qpid-stat -q shows the same number of messages.
>
> Is this a bug in qpid-stat or are those messages waiting for some
> timeout before they become available again?

Acquired and accepted messages should be dequeued when the broker gets 
the accept and would then be reflected in the dequeued count shown by 
qpid-stat.

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


Re: browse queue

Posted by Bill Whiting <te...@bellsouth.net>.
Thanks, I'm able to browse messages non-destructively and I can 
acquire/accept an individual message and remove it from the queue; 
however, qpid-stat -q shows the same number of messages.

Is this a bug in qpid-stat or are those messages waiting for some 
timeout before they become available again?

//Bill

On 09/09/2009 11:14 AM, Gordon Sim wrote:
> On 09/09/2009 04:06 PM, Bill Whiting wrote:
>> Is there sample code or explanation in the documentation on how to
>> browse a queue.
>
> No, but I have a Jira open for some doc improvements and have noted 
> this as one of them (feel free to add more comments to that).
>
>> I have setup a local queue and subscribed to messages from a queue in
>> the broker. I set acquire mode to pre-acquire and the accept mode to 
>> none.
>>
>> The messages are still removed from the broker's queue even though I
>> don't accept the message.
>
> You want to set the acquire mode to 'not acquired'.
>
> ---------------------------------------------------------------------
> 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: browse queue

Posted by Gordon Sim <gs...@redhat.com>.
On 09/09/2009 04:06 PM, Bill Whiting wrote:
> Is there sample code or explanation in the documentation on how to
> browse a queue.

No, but I have a Jira open for some doc improvements and have noted this 
as one of them (feel free to add more comments to that).

> I have setup a local queue and subscribed to messages from a queue in
> the broker. I set acquire mode to pre-acquire and the accept mode to none.
>
> The messages are still removed from the broker's queue even though I
> don't accept the message.

You want to set the acquire mode to 'not acquired'.

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