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.
Asked
Active
Viewed 7,390 times
1 Answers
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
-
Is it possible to apply it only on specific queues? – Fractaliste Jun 01 '17 at 08:26
-
Not with the default version as far as I know but using it as a template you could always write your own broker plugin to decide which message to modify – Tim Bish Jun 01 '17 at 13:09