You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by stirlingc <sc...@alarmpoint.com> on 2009/12/17 19:40:38 UTC

Purged messages still appear in JMX browseAsTable

I have a test case in ActiveMQ 5.3 that is failing and would like to know if
this is expected behaviour or a bug.

Here's the test:
1) Create 100 test messages in a queue
2) Use jconsole and verify that the queue size is 100
3) Use jconsole and browseAsTable() to view the messages
4) Use jconsole and purge() to delete the messages
5) Use jconsole and verify that the queue size is 0
6) Use jconsole and browseAsTable() to verify that no messages are viewable

The test fails at step (6).  It seems that regardless of how I try to delete
the messages, they are still returned by the queue browser.  I have tried
this test with both PERSISTENT and NON-PERSISTENT messages --- the behaviour
is the same.

This behaviour seems incorrect to me.  If this is normal behaviour, then is
creating a dummy consumer with a selector to choose the messages that I want
deleted the only way to permanently remove messages from a queue?

Thanks,
Stirling
-- 
View this message in context: http://old.nabble.com/Purged-messages-still-appear-in-JMX-browseAsTable-tp26832947p26832947.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Purged messages still appear in JMX browseAsTable

Posted by Dejan Bosanac <de...@nighttale.net>.
Hi,

can you raise a Jira issue with all these info?

Cheers
--
Dejan Bosanac - http://twitter.com/dejanb

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net



On Thu, Dec 17, 2009 at 8:54 PM, stirlingc <sc...@alarmpoint.com> wrote:
>
> Just a quick followup, I looked into org.apache.activemq.broker.region.Queue
> to see where the supposedly deleted messages were coming from and they're
> being picked up from the "pagedInPendingDispatch" list during doBrowse(...):
>
>    // Messages that are paged in but have not yet been targeted at a
> subscription
>    private List<QueueMessageReference> pagedInPendingDispatch = new
> ArrayList<QueueMessageReference>(100);
>
> public void doBrowse(boolean forcePageIn, List<Message> l, int max) {
>        final ConnectionContext connectionContext =
> createConnectionContext();
>        try {
>            pageInMessages(forcePageIn);
>            List<MessageReference> toExpire = new
> ArrayList<MessageReference>();
>            synchronized(dispatchMutex) {
>                synchronized (pagedInPendingDispatch) {
> -->                    addAll(pagedInPendingDispatch, l, max, toExpire);
> ...
>
> This list does not get modified during deletion of a message, so is caching
> a copy of the deleted messages.
>
> --
> View this message in context: http://old.nabble.com/Purged-messages-still-appear-in-JMX-browseAsTable-tp26832947p26833977.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>

Re: Purged messages still appear in JMX browseAsTable

Posted by stirlingc <sc...@alarmpoint.com>.
Just a quick followup, I looked into org.apache.activemq.broker.region.Queue
to see where the supposedly deleted messages were coming from and they're
being picked up from the "pagedInPendingDispatch" list during doBrowse(...):

    // Messages that are paged in but have not yet been targeted at a
subscription
    private List<QueueMessageReference> pagedInPendingDispatch = new
ArrayList<QueueMessageReference>(100);

public void doBrowse(boolean forcePageIn, List<Message> l, int max) {
        final ConnectionContext connectionContext =
createConnectionContext();
        try {
            pageInMessages(forcePageIn);
            List<MessageReference> toExpire = new
ArrayList<MessageReference>();
            synchronized(dispatchMutex) {
                synchronized (pagedInPendingDispatch) {
-->                    addAll(pagedInPendingDispatch, l, max, toExpire);
...

This list does not get modified during deletion of a message, so is caching
a copy of the deleted messages.

-- 
View this message in context: http://old.nabble.com/Purged-messages-still-appear-in-JMX-browseAsTable-tp26832947p26833977.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.