Routing a request asynchronously
When you send a message using the ProducerTemplate.sendBody() method into a Camel endpoint, you may find that even though it contains asynchronous processing, such as through the threads DSL (see the Spreading the load within a route using a set of threads recipe), your original thread is blocked until the request is fully processed. This is by design, as Camel will not return unless the message was fully processed—keeping track of whether an exchange was fully processed is one of the roles of Camel's Asynchronous Routing Engine.
This recipe will explain how to interact with Camel asynchronously through a ProducerTemplate instance, so that you can continue doing other work while a message submitted to Camel is being ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access