Hi Claus, I have found how to set it though a property of ActiveMq (* ActiveMQMessageProducer*<http://activemq.apache.org/maven/activemq-core/apidocs/src-html/org/apache/activemq/ActiveMQMessageProducer.html#line.71> ) --> timeToLive = JMSExpiration
Here is the uri to be used in Camel to(uri="activemq.topic.toto?timeToLive=1000") Regards, Charles Moulliard Senior Enterprise Architect (J2EE, .NET, SOA) Apache Camel - Karaf - ServiceMix Committer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Blog : http://cmoulliard.blogspot.com | Twitter : http://twitter.com/cmoulliard Linkedin : http://www.linkedin.com/in/charlesmoulliard | Skype: cmoulliard On Wed, Aug 18, 2010 at 12:51 PM, Claus Ibsen <claus.ib...@gmail.com> wrote: > Hi > > Yeah you can set the expiration. This code does it > } else if (headerName.equals("JMSExpiration")) { > > jmsMessage.setJMSExpiration(ExchangeHelper.convertToType(exchange, > Long.class, headerValue)); > > However I can't remember the JMS spec but its kinda wacky in this > area. As you may have to set the value as an absolute time in millis. > For example having to add System.currentTimeMillis() to the given > value. And then you have to ensure the clocks between the > client/servers are in somewhat of a sync. > > > Read the JMS spec about this option. > > > > On Tue, Aug 17, 2010 at 8:42 PM, Charles Moulliard <cmoulli...@gmail.com> > wrote: > > Hi, > > > > We try to define the JMS header property JMSExpiration in a camel route > > like this > > > > <from uri=""/> > > <to uri="bean:toto"/> > > <setHeader headerName="JMSExpiration "> > > <constant>1000</constant> > > </setHeader> > > <to uri="activemq;topic:toto"/> > > > > Unfortunately, messages are created in the topic but the JMSExpiration > > header is not set. > > > > Can we configure the route like or do we have to use a producerTemplate > > where we can provide the Body and Headers ? > > > > Regards, > > > > Charles Moulliard > > > > Senior Enterprise Architect (J2EE, .NET, SOA) > > Apache Camel - Karaf - ServiceMix Committer > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Blog : http://cmoulliard.blogspot.com | Twitter : > > http://twitter.com/cmoulliard > > Linkedin : http://www.linkedin.com/in/charlesmoulliard | Skype: > cmoulliard > > > > > > -- > Claus Ibsen > Apache Camel Committer > > Author of Camel in Action: http://www.manning.com/ibsen/ > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus >