Reputation: 3
I am trying to call a camel route xml from the Java method. Is it possible to call and return to the same method again?
Upvotes: 0
Views: 2937
Reputation: 7025
Yes, you can use a ProducerTemplate for that.
If your caller has to wait for the route to complete, your route must be executed synchronously (for example direct
routes). See exchange pattern for more details.
If you expect a response from the route you should use one of the request*
methods of the producer template (not the send*
methods).
Upvotes: 1