You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Dziugas Baltrunas <dz...@baltrunas.lt> on 2007/08/06 14:58:42 UTC

When QueueView.purge() does not actually purge?

Hello,

I'm using Apache ActiveMQ 4.1.1 with the default configuration. I
noticed that in some cases JMX expoded purge() method does not
actually purge messages from the queue.

I'm not yet able to reproduce the situation, so I'll just describe
some details. My producer side is standard Java application and
consumer side is made using activemq-cpp (2.01, openWire protocol).
When cpp consumer fails with some unhandled IOException (for example,
when BytesMessage body is empty), message is not removed from the
queue (since it's not acknowledged?). However, trying to remove it by
using JMX purge() does not remove message from queue. What is more,
restarting activemq process also does not help - when the queue is
recreated (via session.createQueue()), old messages appear again in
the queue. Only deleting queue via JMX removeQueue() helps. Looks like
it happens for messages having both PERSISTENT and NON_PERSISTENT
delivery modes.

I'm wondering to know in which circumstances purge() might not
actually purge the queue and why ActiveMQ process restart does not
flush the data for NON_PERSISTENT messages?

Thanks in advance.

Regards,
Dziugas Baltrunas

Re: When QueueView.purge() does not actually purge?

Posted by Dziugas Baltrunas <dz...@baltrunas.lt>.
Hi,

any thoughts on this issue?

What I've also faced is that especially with activemq-cpp, when the
process is killed abnormally (that is, without closing connection to
broker), ActiveMQ broker keeps connection as active (visible via JMX,
org.apache.activemq->localhost->Connection->openwire) and the
ConsumerCount for the queues now already dead connection was listening
to also does not decrease.

So the questions narrow to the following:

1. Why killing activemq-cpp process abnormally does not flush the
connection from the broker and dead connection is visible as "active"
from within JMX?

2. Why non-persistent messages keep staying in the queue when
activemq-cpp async consumer with cms::Session::AUTO_ACKNOWLEDGE mode
crashes with exception (like reading empty String property, in
activemq::connector::openwire::utils::OpenwireStringSupport::readString)?

3. Why JMX QueueView.purge() method does not actually purge queue (for
those messages appeared due to activemq-cpp crash)?

Thanks.

Regards,
Dziugas Baltrunas

On 8/6/07, Dziugas Baltrunas <dz...@baltrunas.lt> wrote:
> Hello,
>
> I'm using Apache ActiveMQ 4.1.1 with the default configuration. I
> noticed that in some cases JMX expoded purge() method does not
> actually purge messages from the queue.
>
> I'm not yet able to reproduce the situation, so I'll just describe
> some details. My producer side is standard Java application and
> consumer side is made using activemq-cpp (2.01, openWire protocol).
> When cpp consumer fails with some unhandled IOException (for example,
> when BytesMessage body is empty), message is not removed from the
> queue (since it's not acknowledged?). However, trying to remove it by
> using JMX purge() does not remove message from queue. What is more,
> restarting activemq process also does not help - when the queue is
> recreated (via session.createQueue()), old messages appear again in
> the queue. Only deleting queue via JMX removeQueue() helps. Looks like
> it happens for messages having both PERSISTENT and NON_PERSISTENT
> delivery modes.
>
> I'm wondering to know in which circumstances purge() might not
> actually purge the queue and why ActiveMQ process restart does not
> flush the data for NON_PERSISTENT messages?
>
> Thanks in advance.
>
> Regards,
> Dziugas Baltrunas
>