org.apache.camel
Interface BatchConsumer
- All Superinterfaces:
- Consumer, Service
- All Known Implementing Classes:
- FileConsumer, GenericFileConsumer
public interface BatchConsumer
- extends Consumer
A consumer of a batch of message exchanges from an Endpoint
- Version:
- $Revision: 835240 $
setMaxMessagesPerPoll
void setMaxMessagesPerPoll(int maxMessagesPerPoll)
- Sets a maximum number of messages as a limit to poll at each polling.
Can be used to limit eg to 100 to avoid when starting and there are millions
of messages for you in the first poll.
Is default unlimited, but use 0 or negative number to disable it as unlimited.
- Parameters:
maxMessagesPerPoll
- maximum messages to poll.
processBatch
void processBatch(Queue<Object> exchanges)
throws Exception
- Processes the list of
Exchange
in a batch.
Each message exchange will be processed individually but the batch
consumer will add properties with the current index and total in the batch.
The items in the Queue may actually be Holder objects that store other
data alongside the Exchange.
- Parameters:
exchanges
- list of items in this batch
- Throws:
Exception
- if an internal processing error has occurred.
Copyright © 2007-2009 The Apache Software Foundation. All Rights Reserved.