Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
https://camel.apache.org/staging/
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.

Batch Consumer

Available as of Camel 2.0

Batch Consumer is basically a Polling Consumer that is capable of polling multiple Exchanges in a pool. The interface org.apache.camel.BatchConsumer should be implemented by a consumer to indicate that it supports batching.

The following components support the use of a Batch Consumer:

Consumer Options

Option

Description

maxMessagesPerPoll

An integer to define a maximum messages to gather per poll. By default no maximum is set. Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files. Set a value of 0 or negative to disable it.

Exchange Properties

The following properties is set on the Exchange for each Exchange polled in the same batch.

Property

Description

CamelBatchComplete

boolean indicating the last Exchange in the batch. Is only true for the last entry.

CamelBatchIndex

The current index of the batch. Starts from 0.

CamelBatchSize

The total number of Exchanges that was polled in this batch.

See Also

© 2004-2015 The Apache Software Foundation.
Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram