Hi
I am trying to create the routes dynamically in
*addRoutesToCamelContext(CamelContext context)* method, instead of
configuring the routes in the configure() method. Reason is, I have to
fetch the routes from the database instead of static configuration.
the below similar example of Java DSL, I created using RouteDefinition and
added the route definition into the camel context.
Java DSL
-----------
from("jms:queue:eix.sorter.queue")
.process(new com.qr.eix.processor.SorterProcessor())
.process(new com.qr.eix.processor.SorterProcessor1()).choice()
.when()
.simple("${body.msgType} == 'FFR'")
.to("jms:queue:eix.ffr.queue")
.when()
.simple("${body.msgType} == 'FFM'")
.to("jms:queue:eix.ffm.queue")
.otherwise()
.to("jms:queue:eix.parser.queue");
Similar Dynamic Routes
----------------------------
RouteDefinition rDefintion = new RouteDefinition();
rDefintion.from(from);
rDefintion.process(new com.qr.eix.processor.SorterProcessor());
rDefintion.process(new com.qr.eix.processor.SorterProcessor1());
rDefintion.choice().when().simple(buildFFRString);
rDefintion. to(ffrto)
rDefintion.choice().when().simple(buildFFMString);
rDefintion.to(ffmto)
rDefintion.choice().otherwise();
rDefintion.to(generalTo)
With the above CBR is not working and i am not getting the print statements
inserted inthe processor class..let me know where i am wrong...
Thanks
Jawahar
--
View this message in context:
http://camel.465427.n5.nabble.com/Dynamic-Route-Creation-tp5725835.html
Sent from the Camel - Users mailing list archive at Nabble.com.