In a project on which I am currently working, I am using Spring Integration
to send JMS messages to a ActiveMQ queue. I can successfully send messages
to the queue, but I have as of yet been unable to set a non-zero JMSExpiration
value on the messages. This is resulting in messages 'stacking up' in the
queue if there is no active consumer.

I have tried specifying 'time-to-live' as an attribute of my outbound
JMS channel adapter:

Code:
  <jms:outbound-channel-adapter id="msg.out"  
      connection-factory="externalConnectionFactory"  
      channel="outbound.msg" destination="outbound.msg.q" 
      time-to-live="10000"/>
I have also tried using a JMS template:

Code:
  <bean id="testJmsTemplate" class="org.springframework.jms.core.JmsTemplate" >
    <property name="connectionFactory" ref="externalConnectionFactory" />
    <property name="defaultDestinationName" value="outbound.msg.q" />
    <property name="explicitQosEnabled" value="true" />
    <property name="deliveryPersistent" value="false" />
    <property name="timeToLive" value="10000" />
  </bean>
  
  <jms:outbound-channel-adapter id="msg.out" 
     jms-template="testJmsTemplate" 
     channel="outbound.msg" />
Neither approach seems to work. In both cases, outbound messages have an
expiration value of '0'.

I would greatly appreciate any ideas you could provide to me on how to
address the problem and/or further debug the issue.

Thank you.

Technologies employed:
Spring 3.1.1
Spring Integration 2.1.0
ActiveMQ 5.6.0