1

I am trying to set the TTL on JmsTemplate but the messages never expire. When I set a TTL on a message using the ActiveMQ Web Console it does expire after the set period.

This is what I have now:

<bean id="shortTtlJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <constructor-arg ref="jmsConnectionFactory"/>
    <property name="explicitQosEnabled" value="true"/>
    <property name="deliveryPersistent" value="false"/>
    <property name="receiveTimeout" value="10000"/>
    <property name="timeToLive" value="10000"/>
</bean>

<bean id="shortTtlJmsMessagingTemplate" class="org.springframework.jms.core.JmsMessagingTemplate">
    <constructor-arg ref="shortTtlJmsTemplate"/>
</bean>

The documentation only says that I have to set explicitQosEnabled to true but apparently this is not enough. Does anyone know what I am doing wrong?

Yosef Weiner
  • 5,432
  • 1
  • 24
  • 37
ZT827
  • 161
  • 1
  • 2
  • 12

1 Answers1

1

Apparently it wasn't working due to a clock synchronisation issue. The clocks are in sync now and everything is working as expected.

ZT827
  • 161
  • 1
  • 2
  • 12