Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Time to live for all messages in activemq queue

Tags:

jms

activemq

ttl

I'm new in activemq and jms and I need to set a ttl for all messages in my queue. Is there any possibility to set a ttl of all incoming messages in a queue? I only found an option "expireMessagesPeriod" for policyEntry tag, which is responsible for checking frequency of expired messages. I understand that I can set the time to live only for a concrete message, not to the whole queue.

like image 215
KillSwitch Avatar asked Dec 14 '15 07:12

KillSwitch


1 Answers

ActiveMQ provides a TimeStampBrokerPlugin that can be used to apply TTL values to message that arrive without a set TTL. You configure the plugin in your activemq.xml and can use the 'zeroExpirationOverride' value to configure the preferred TTL.

<plugins>
  <timeStampingBrokerPlugin/>
</plugins>
like image 89
Tim Bish Avatar answered Dec 31 '22 13:12

Tim Bish