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 different thread, or thread pool. This is discussed in the Spreading the load within a route using a set of threads recipe.
This recipe will show you how to increase the number of consumer threads for asynchronous consuming endpoints such as seda:
.