Hi List, I have been trying to configure dynamic uri but could not find a relevant way to complete this task. Below is the problem description.
1. Client 1 posts to ROUTE 1 and waits for a response 2. ROUTE 1 uses pollenrich and polls a queue (SECOND) and gets a specific message using selector "head='jagan'". 3. ROUTE 2 and ROUTE 3 are InOnly routes 4. ROUTE 2 sets header head:naidu and sends to queue SECOND 5. ROUTE 3 sets header head:jagan and sends to queue SECOND 6. ROUTE 1 users static uri "activemq:queue:SECOND?selector=head='jagan'" Problem: I want this to be dynamic. I want set this dynamically using the exchange posted by client. I followed this http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html. But I could not find a relevant consumer template working example. Please advice. ############################################## 1. ROUTE 1 ############################################## blueprint.xml <bean id="myStrat" class="org.bean.test.MyStrat"/> <camelContext id="jetty1" xmlns="http://camel.apache.org/schema/blueprint"> <route id="TO QUEUE ONE"> <from uri="restlet:http://127.0.0.1:1230/qqq?restletMethod=POST"/> <setHeader headerName="dynamic"><simple>jagan</simple></setHeader> <pollEnrich uri="activemq:queue:SECOND?selector=head='jagan'" strategyRef="myStrat" timeout="30000"/> </route> </camelContext> MyStrat.java public class MyStrat implements AggregationStrategy { Logger log = Logger.getLogger(MyStrat.class); public Exchange aggregate(Exchange oldExchange, Exchange newExchange) { if (oldExchange == null) { return newExchange; } String newBody = newExchange.getIn().getBody(String.class); log.info("Hello 1" + newBody); String oldBody = oldExchange.getIn().getBody(String.class); log.info("hello 2" + oldBody); newExchange.getIn().setBody(newBody); log.info("hello 3" + newBody); return newExchange; ########################################################################## ROUTE 2 ########################################################################## blueprint.xml <camelContext id="jetty1" xmlns="http://camel.apache.org/schema/blueprint"> <route id="jetty1-1"> <from uri="restlet:http://127.0.0.1:1236/abc?restletMethod=POST"/> <setExchangePattern pattern="InOnly"/> <setHeader headerName="head"><simple>naidu</simple></setHeader> <to uri="activemq:queue:SECOND"/> </route> </camelContext> ######################################################################## ROUTE 3 ######################################################################## blueprint.xml <camelContext id="jetty1" xmlns="http://camel.apache.org/schema/blueprint"> <route id="jetty1-1"> <from uri="restlet:http://127.0.0.1:1237/abc?restletMethod=POST"/> <setExchangePattern pattern="InOnly"/> <setHeader headerName="head"><simple>jagan</simple></setHeader> <to uri="activemq:queue:SECOND"/> </route> </camelContext> -- Thanks & Regards B Jagannath Keen & Able Computers Pvt. Ltd. +919871324006