Reputation: 11
I have two different Processes. One read some csv file and store it in DB and other fetch the record from DB and calculate some value and store it in DB. I want to call the second process at the completion of the first. Is it possible to do this with the help of the camel.
Upvotes: 1
Views: 1138
Reputation: 1771
You have many possibilities to connect one route to each other:
More information can be found here: https://camel.apache.org/components.html
Upvotes: 2
Reputation: 756
To 'call' another route when one route has finished you just send the exchange to that route with a .to()
and the direct component.
from("file:/csv-drop/")
.to(db:store)
.to("direct:calculate-value-and-store")
in another route builder or the same route builder:
from("direct:calculate-value-and-store")
.to(db:get)
.process(new CalculateValueProcessor())
.to(db:store)
This code above won't work but it gives you an idea of what using two routes looks like.
Upvotes: 2