简体   繁体   中英

Add camel route at runtime using xml configuration available in database

I am new to camel

I want to build an generic API in which routing information are available in database in xml format (information are coming from web application).

Now another web application made some event then routing information id passed to this generic API then it creates route and process give response back to web application (I think this is event based routing correct me if I am wrong).

how can i achieve using

suggest some link or give example how to start here?

I have basic knowledge about Camel(worked with file,jdbc,cxf component in standalone application).

I already gone through Add camel route at runtime in Java where I found " Do you want the complete route to be dynamic? Then you can only use xml." – Christian Schneider

Thanks in advance.

If your routes are in the same xml format as we write in spring files then you can parse them into RouteDefinition and add those to existing CamelContext . Check out these files for some idea : org.apache.camel.spring.handler.CamelNamespaceHandler and org.apache.camel.model.RouteDefinition`.

after obtaining an instance of route definition you can add it to context as context.addRouteDefinition() .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM