1

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.

Community
  • 1
  • 1
Darshan Patel
  • 3,176
  • 6
  • 26
  • 49

1 Answers1

1

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 andorg.apache.camel.model.RouteDefinition`.

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

Sikorski
  • 2,653
  • 3
  • 25
  • 46
  • Thanks for reply but i have not created final design how routes are store in database, initially i thought there are separate table for endpoint(contains component related information for eq uri information),scheme table contains scheme id, and few more table but it is not under development phase,so i can change design reletively. – Darshan Patel Jan 24 '14 at 06:14
  • web application that takes route information from user is also developed by us so i think it is good to create different table rather than storing entire route defination in one xml file – Darshan Patel Jan 24 '14 at 06:15