7

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.

KillSwitch
  • 132
  • 2
  • 10

1 Answers1

6

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>
Tim Bish
  • 17,475
  • 4
  • 32
  • 42