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?