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: 782062 $

Method Summary
 void processBatch(Queue exchanges)
          Processes the list of Exchange in a batch.
 void setMaxMessagesPerPoll(int maxMessagesPerPoll)
          Sets a maximum number of messages as a limit to poll at each polling.
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Method Detail

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 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.

Parameters:
exchanges - list of exchanges in this batch
Throws:
Exception - if an internal processing error has occurred.


Apache CAMEL