You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by patsfan <ap...@gmail.com> on 2012/06/20 21:00:51 UTC

Negative Queue Size in 5.3.2

Hi All,

We are running into a case where our queue size is < 0 via both the
webconsole and via jmx in 5.3.2.  Here is our scenario:

VM1: looping 5000 times, each time pushing a message into a queue
VM2: listening on the queue (1 listener) and processing the messages
VM2: responds to a REST call by purging messages from the queue by a
particular property (QueueViewMBean.removeMatchingMessages(...)).

After calling QueueViewMBean.removeMatchingMessages(...) (deletes > 1K
messages from the queue) the queue size goes negative.  Saw a few posts that
are related, but they go back a few years with no clear resolution.  

Has anyone seen this?  Please let me know if you need additional
information, would gladly supply.

Thanks in advance,
Al

--
View this message in context: http://activemq.2283324.n4.nabble.com/Negative-Queue-Size-in-5-3-2-tp4653409.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Negative Queue Size in 5.3.2

Posted by patsfan <ap...@gmail.com>.
RE: Could you try your scenario with the current 5.6 release to see if it is
still reproducible. 

Just tried it and yes, it still reproducable.  I found your blog (thanks!)
about the prefetch size and the negative number for the queue count. 
Confirmed that the negative value is smaller when going from prefetch size
of 1000 to 10.

RE: What is the intent here? 

We have an operational requirement to give people the ability to "cancel" a
queued event.  Part of the cancel event is to remove 1 or more jms messages
from the target queue.  Some of the processing by a consumer makes SOAP
calls to a service that can be unreliable (hangs).  If we detect this
scenario we want to be able to remove other jms messages from the queue that
would run into this scenario.

RE: Unlike competing consumers, the jmx op bypasses dispatch, so if you do 
the jmx op when there are no consumers I would expect 
different behavior. 

After running into the < 0 queue count size, I stopped the consumers and
filled the queue up again to 5000 and then deleted the 5K message via jmx. 
the jmx operation reported 5K messages deleted (as expected) but the < 0
queue count size remained.  But agreed, if the queue size is 0, no consumers
listening and u fill the queue to 5K and the delete the 5K the count will go
back to 0.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Negative-Queue-Size-in-5-3-2-tp4653409p4653438.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Negative Queue Size in 5.3.2

Posted by Gary Tully <ga...@gmail.com>.
that looks like a sync issue between the jmx op and the destination
w.r.t counters.
Possibly messages that are dispatched and inflight to the consumer are
getting removed so they are acked twice.
inflight messages should really be invisible to a remove message call
via jmx but I guess that is debatable.

Could you try your scenario with the current 5.6 release to see if it
is still reproducible.
What is the intent here?
Unlike competing consumers, the jmx op bypasses dispatch, so if you do
the jmx op when there are no consumers I would expect
different behavior.

If you want to limit the queue size, message expiry is the preferred way to go.

On 20 June 2012 20:00, patsfan <ap...@gmail.com> wrote:
> Hi All,
>
> We are running into a case where our queue size is < 0 via both the
> webconsole and via jmx in 5.3.2.  Here is our scenario:
>
> VM1: looping 5000 times, each time pushing a message into a queue
> VM2: listening on the queue (1 listener) and processing the messages
> VM2: responds to a REST call by purging messages from the queue by a
> particular property (QueueViewMBean.removeMatchingMessages(...)).
>
> After calling QueueViewMBean.removeMatchingMessages(...) (deletes > 1K
> messages from the queue) the queue size goes negative.  Saw a few posts that
> are related, but they go back a few years with no clear resolution.
>
> Has anyone seen this?  Please let me know if you need additional
> information, would gladly supply.
>
> Thanks in advance,
> Al
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Negative-Queue-Size-in-5-3-2-tp4653409.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://fusesource.com
http://blog.garytully.com