[ 
https://issues.apache.org/activemq/browse/AMQ-1112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51130#action_51130
 ] 

Gary Tully commented on AMQ-1112:
---------------------------------

just fyi I am highlighting the workaround from the post linked above.
{quote}In the end I implemented a workaround that was simply a thread that 
periodically cleared my queues of expired messages. The way it did so was to 
use a MessageConsumer and use a JMSSelector to consume only those messages that 
had expired. I don't believe the consumer itself actually ever receives any 
messages, but the act of looking for them causes ActiveMQ to expunge the 
expired messages.

e.g:
                MessageConsumer c = sess.createConsumer(dest, "JMSExpiration < 
" + System.currentTimeMillis());
                Message m = c.receiveNoWait();
                if (m != null) log.error("Returned an expired message");
{quote}


> remove expired messages from Store and update Message cursors
> -------------------------------------------------------------
>
>                 Key: AMQ-1112
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1112
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.0.0
>            Reporter: Rob Davies
>            Assignee: Rob Davies
>             Fix For: 5.3.0
>
>
> Ensure messages that are expired are removed from message store and message 
> cursrors are also updated consistently

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to