Hi,

I am trying to create a dynamic camel route based on route values obtained
from databases. All the dynamic routes needs to be kicked of by this DB
producer. Below is a sample scenario we are trying to achieve.

CustomTaskFactory:
       1. Read route information from DB
       2. Send the Route object to a Dynamic Router
       pseudocode:
       
producertemplate.send(Route).dynamicrouter("bean:RoutingTask","routeTask")

RoutingTask:
       1. If the route is a DBPoller route then return
"bean:DBPollerTaskFactory?method=generateTasks"
       2. If the route is a MQ endpoint listener route then return
"bean:MQTaskFactory?method=generateTasks"

DBPollerTaskFactory:
       1. Recieve the Route object and then create a DBpolling task like
below in the method generateTasks:
           public void generateTasks(final Route route_)
          {
                camelcontext.addroutes(new RouteBuilder(){

                                    configure()
                                    {
                                       
from("timer://myDBpoller?period="+route_.getPollingDelay).routeid(route_.getID).setbody().constant(route_.getID()).bean("DBPollerTask","processTask")
                                    }});
          }


I am facing various problems in achieving the same. Need some help in
achieving the same.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Need-to-create-dynamic-camel-routes-tp5548714p5548714.html
Sent from the Camel Development mailing list archive at Nabble.com.

Reply via email to