Re: remove DLQ message

2014-01-06 Thread artnaseef
setJMSExpiration() uses a JMS-provider-specific value.  For ActiveMQ, that's
the time of expiration in millis.

Try this instead:

   messageReference.getMessage().setExpiration(System.currentTimeMillis() +
60*60*1000);




--
View this message in context: 
http://activemq.2283324.n4.nabble.com/remove-DLQ-message-tp4675686p4676067.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: remove DLQ message

2013-12-25 Thread damon
I add a filter plugin to set the expiration for the DLQ message,  but seems
it doesn't work, 
the message sent to DLQ still has not expiration.

   @Override
   public void sendToDeadLetterQueue(ConnectionContext context,
MessageReference messageReference,
   Subscription subscription){

 //set the expiration
 messageReference.getMessage().setExpiration(60*60*1000);
 this.next.sendToDeadLetterQueue(context, messageReference,
subscription);
}



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/remove-DLQ-message-tp4675686p4675868.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: remove DLQ message

2013-12-23 Thread Christian Posta
Could you have a camel route or some process periodically consume the
DLQ and process them/ignore them?

Alternatively you could create a broker filter that sets a specific
expiration anytime (eg, 5 min or something) whenever a message is sent
to DLQ...

http://activemq.apache.org/interceptors.html

http://activemq.apache.org/maven/apidocs/org/apache/activemq/broker/BrokerFilter.html#sendToDeadLetterQueue(org.apache.activemq.broker.ConnectionContext,%20org.apache.activemq.broker.region.MessageReference,%20org.apache.activemq.broker.region.Subscription)



On Thu, Dec 19, 2013 at 2:16 AM, damon  wrote:
> Can I setup the expiration for the DLQ?   I want to keep the DLQ message for
> a period,
> but don't want to keep them all the time.
>
>
>
> --
> View this message in context: 
> http://activemq.2283324.n4.nabble.com/remove-DLQ-message-tp4675686.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta