camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "abhijeet.bongarde" <>
Subject TimeToLive property not working in case of DynamicRouter
Date Tue, 25 Feb 2014 06:43:04 GMT
I am trying to implement TimeToLive for the topic messages using camel
I have two types of topics one is declared through camel.xml and other is
Here is the code snippet for reference:
code in camel.xml:
&lt;from uri="activemq:queue:jpaLogQueue"/&gt;
&lt;to uri="activemq:topic:jpaLogTopic?timeToLive=60000" /&gt;

        &lt;aggregate strategyRef="jpaAggregatorStrategy"
eagerCheckCompletion="true" completionTimeout="5000"&gt;
             &lt;simple&gt;${body} contains 'commit_transaction' || ${body}
contains 'release_unit_of_work'                   &lt;/simple&gt;
       &lt;process ref="scrapMessageFilterProcessor"/&gt;
       &lt;process ref="transactionalMarkerProcessor"/&gt;
${in.headers[Transactional]} == "true" </simple&amp;gt;&lt;br>             
&lt;process ref="jpaSqlMessageTransformer"/&gt;
                          &lt;method ref="DynamicRouter" method="route"/&gt;
                    &lt;to uri="activemq:queue:ActiveMQ.DLQ"/&gt;

Code for DynamicRouter:

public String route(@Body String body, Exchange exchange, Message msg,
			@Header(Exchange.SLIP_ENDPOINT) String previous,@Properties Map<String,
Object> properties) {

*return "activemq:topic: jpa.modelName.vdbVersion-name?timeToLive=60000";*

The property TimeToLive given in the xml creates a topic with message expiry
time as 1 minute but if I provide same property to a Topic created through
Dynamic router, 
it doesn't  honour the timetolive and messages from that topic doesnt expire
after 1 minute.

Is there anything which I am missing out or is there any other way out to
accomplish it?


View this message in context:
Sent from the Camel - Users mailing list archive at
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message