org.apache.camel.processor
Class Aggregator

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.processor.BatchProcessor
          extended by org.apache.camel.processor.Aggregator
All Implemented Interfaces:
Runnable, Service

public class Aggregator
extends BatchProcessor

An implementation of the Aggregator pattern where a batch of messages are processed (up to a maximum amount or until some timeout is reached) and messages for the same correlation key are combined together using some kind of {@link AggregationStrategy ) (by default the latest message is used) to compress many message exchanges * into a smaller number of exchanges.

A good example of this is stock market data; you may be receiving 30,000 messages/second and you may want to throttle it right down so that multiple messages for the same stock are combined (or just the latest message is used and older prices are discarded). Another idea is to combine line item messages together into a single invoice message.

Version:
$Revision: 1.1 $

Constructor Summary
Aggregator(Endpoint endpoint, Processor processor, AggregationCollection collection)
           
Aggregator(Endpoint endpoint, Processor processor, Expression correlationExpression, AggregationStrategy aggregationStrategy)
           
 
Method Summary
 String toString()
           
 
Methods inherited from class org.apache.camel.processor.BatchProcessor
doStart, doStop, getBatchSize, getBatchTimeout, getCollection, getEndpoint, getExceptionHandler, getProcessor, processBatch, processExchange, run, setBatchSize, setBatchTimeout, setExceptionHandler
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, getThreadName, isStarted, isStopped, isStopping, nextThreadCounter, removeChildService, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Aggregator

public Aggregator(Endpoint endpoint,
                  Processor processor,
                  Expression correlationExpression,
                  AggregationStrategy aggregationStrategy)

Aggregator

public Aggregator(Endpoint endpoint,
                  Processor processor,
                  AggregationCollection collection)
Method Detail

toString

public String toString()
Overrides:
toString in class BatchProcessor


Copyright © 2007 Apache Software Foundation. All Rights Reserved.