KillSwitch
KillSwitch

Reputation: 125

Time to live for all messages in activemq queue

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.

Upvotes: 7

Views: 8750

Answers (1)

Tim Bish
Tim Bish

Reputation: 18356

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>

Upvotes: 6

Related Questions