You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Yaswanth <ya...@gmail.com> on 2009/04/09 14:54:26 UTC

Messages are not getting expired and removed from Non-persistent Non-Durable Topic in ActiveMQ 5.2

Hi, 

Messages are not getting expired and removed from Non-persistent Non-Durable
Topic in ActiveMQ 5.2. We are facing a serious production issue.

We are using Object messages and Message producer to produce a message to
Topic. We have tried with setting expiration time on ObjectMessage and
TimeToLive on producer. Inspite of that messages are seen in jConsole and
JBoss JMX console after the expiry time of 60seconds

Below is the code snippet used
objectMessage.setJMSExpiration(60000);
messageProducer.setTimeToLive(60000);
messageProducer.send(destination, objectMessage);

We also tried with subscription recovery policy as below in the embedded
activemq broker. This is also not working
<subscriptionRecoveryPolicy>
<!-- <lastImageSubscriptionRecoveryPolicy />-->
<noSubscriptionRecoveryPolicy/>
<timedSubscriptionRecoveryPolicy recoverDuration="60000" />
</subscriptionRecoveryPolicy>

There is a similar bug logged to Queue for ActiveMQ 5.2. Is this related to
that?
link to the bug  : https://issues.apache.org/activemq/browse/AMQ-1112

Appreciate quick inputs.

Thanks
Yaswanth
-- 
View this message in context: http://www.nabble.com/Messages-are-not-getting-expired-and-removed-from-Non-persistent-Non-Durable-Topic-in-ActiveMQ-5.2-tp22970339p22970339.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Messages are not getting expired and removed from Non-persistent Non-Durable Topic in ActiveMQ 5.2

Posted by Andreas Gies <ag...@progress.com>.
Hi there,

that question pops up now and then and just lust week I have been  
thinking about a similar issue.
It seems that in ActiveMQ there is no such thing as proactively  
evicting messages from the storage
(memory or persistent) that have expired.

There are only three points in time that I am aware of that the  
message broker does a cleanup of expired messages:

1. When a message is about to be dispatched, the broker will check  
whether the message has already expired and won't dispatch it.
2. When a message is paged out/ paged in to/from secondary storage
3. When the broker receives an ACK for a message, it will run the  
cleanup task for the destination portion that resides in memory.

As a result, for destinations with no consumers and quite high usage  
settings, the check will not occur as expected.

The issue you mentioned seems to be related, yes. The latest comment  
kind of gives a workaround by setting a message listener on expired  
messages.
Due to the things I explained above, no messages will ever be  
delivered physically; just the cleanup will be triggered.

Hope that helps
Andreas

On Apr 9, 2009, at 2:54 PM, Yaswanth wrote:

>
> Hi,
>
> Messages are not getting expired and removed from Non-persistent Non- 
> Durable
> Topic in ActiveMQ 5.2. We are facing a serious production issue.
>
> We are using Object messages and Message producer to produce a  
> message to
> Topic. We have tried with setting expiration time on ObjectMessage and
> TimeToLive on producer. Inspite of that messages are seen in  
> jConsole and
> JBoss JMX console after the expiry time of 60seconds
>
> Below is the code snippet used
> objectMessage.setJMSExpiration(60000);
> messageProducer.setTimeToLive(60000);
> messageProducer.send(destination, objectMessage);
>
> We also tried with subscription recovery policy as below in the  
> embedded
> activemq broker. This is also not working
> <subscriptionRecoveryPolicy>
> <!-- <lastImageSubscriptionRecoveryPolicy />-->
> <noSubscriptionRecoveryPolicy/>
> <timedSubscriptionRecoveryPolicy recoverDuration="60000" />
> </subscriptionRecoveryPolicy>
>
> There is a similar bug logged to Queue for ActiveMQ 5.2. Is this  
> related to
> that?
> link to the bug  : https://issues.apache.org/activemq/browse/AMQ-1112
>
> Appreciate quick inputs.
>
> Thanks
> Yaswanth
> -- 
> View this message in context: http://www.nabble.com/Messages-are-not-getting-expired-and-removed-from-Non-persistent-Non-Durable-Topic-in-ActiveMQ-5.2-tp22970339p22970339.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

---
Mit freundlichen Grüssen - Kind Regards
Andreas Gies
Principal Consultant
Open Source Center of Competence

Progress Software GmbH
Agrippinawerft 26
50678 Köln

E-Mail      	agies@progress.com
Direct Line 	+49 (0)9953 980349
Mobile      	+49 (0)170 5759611
Skype        	+44 (0)20 3239 2922
Skype       	+353 (0)1 443 4971
Skype       	+1 (0)781 262 0168

http://www.progress.com
http://fusesource.com
http://open-source-adventures.blogspot.com



-------------------------------------------------------
Progress Software GmbH
Sitz der Gesellschaft: Agrippinawerft 26, 50678 Koeln;
Niederlassung: Fuerstenrieder Str. 279, 81377 Muenchen
Amtsgericht Koeln, HRB 15620; 
Geschaeftsfuehrung: David Ireland
-------------------------------------------------------