Increasing message consumption through multiple endpoint consumers

One of the simplest ways of increasing throughput is to raise the number of threads that are consuming from an endpoint.

This recipe assumes that you are starting with a route that is asynchronous, for example using seda: as the consumer endpoint (using the from DSL statement). SEDA is a mechanism included in Camel Core for connecting routes to each other asynchronously by passing Exchange objects over an in-memory queue—see the Asynchronously connecting routes recipe in Chapter 1, Structuring Routes.

This is important as an endpoint such as direct: always uses the calling thread for executing the processing steps, so you need to use different techniques to switch processing to a ...

Get Apache Camel Developer's Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.