|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.impl.ServiceSupport org.apache.camel.processor.aggregate.AggregateProcessor
public class AggregateProcessor
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 AggregationStrategy
(by default the latest message is used) to compress many message exchanges
into a smaller number of exchanges.
Constructor Summary | |
---|---|
AggregateProcessor(CamelContext camelContext,
Processor processor,
Expression correlationExpression,
AggregationStrategy aggregationStrategy,
ExecutorService executorService)
|
Method Summary | |
---|---|
protected void |
doShutdown()
Implementations override this method to perform customized shutdown |
protected void |
doStart()
|
protected void |
doStop()
|
AggregationRepository |
getAggregationRepository()
|
Integer |
getCloseCorrelationKeyOnCompletion()
|
long |
getCompletionInterval()
|
Predicate |
getCompletionPredicate()
|
int |
getCompletionSize()
|
Expression |
getCompletionSizeExpression()
|
long |
getCompletionTimeout()
|
Expression |
getCompletionTimeoutExpression()
|
ExceptionHandler |
getExceptionHandler()
|
String |
getTraceLabel()
Gets the trace label used for logging when tracing is enabled. |
boolean |
hasNext()
Are there more outputs? |
protected String |
isCompleted(String key,
Exchange exchange)
Tests whether the given exchange is complete or not |
boolean |
isCompletionFromBatchConsumer()
|
boolean |
isDiscardOnCompletionTimeout()
|
boolean |
isEagerCheckCompletion()
|
boolean |
isIgnoreInvalidCorrelationKeys()
|
boolean |
isParallelProcessing()
|
List<Processor> |
next()
Next group of outputs |
protected Exchange |
onAggregation(Exchange oldExchange,
Exchange newExchange)
|
protected void |
onCompletion(String key,
Exchange exchange,
boolean fromTimeout)
|
void |
process(Exchange exchange)
Processes the message exchange |
void |
setAggregationRepository(AggregationRepository aggregationRepository)
|
void |
setCloseCorrelationKeyOnCompletion(Integer closeCorrelationKeyOnCompletion)
|
void |
setCompletionFromBatchConsumer(boolean completionFromBatchConsumer)
|
void |
setCompletionInterval(long completionInterval)
|
void |
setCompletionPredicate(Predicate completionPredicate)
|
void |
setCompletionSize(int completionSize)
|
void |
setCompletionSizeExpression(Expression completionSizeExpression)
|
void |
setCompletionTimeout(long completionTimeout)
|
void |
setCompletionTimeoutExpression(Expression completionTimeoutExpression)
|
void |
setDiscardOnCompletionTimeout(boolean discardOnCompletionTimeout)
|
void |
setEagerCheckCompletion(boolean eagerCheckCompletion)
|
void |
setExceptionHandler(ExceptionHandler exceptionHandler)
|
void |
setIgnoreInvalidCorrelationKeys(boolean ignoreInvalidCorrelationKeys)
|
void |
setParallelProcessing(boolean parallelProcessing)
|
String |
toString()
|
Methods inherited from class org.apache.camel.impl.ServiceSupport |
---|
addChildService, doResume, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AggregateProcessor(CamelContext camelContext, Processor processor, Expression correlationExpression, AggregationStrategy aggregationStrategy, ExecutorService executorService)
Method Detail |
---|
public String toString()
toString
in class Object
public String getTraceLabel()
Traceable
getTraceLabel
in interface Traceable
public List<Processor> next()
Navigate
next
in interface Navigate<Processor>
public boolean hasNext()
Navigate
hasNext
in interface Navigate<Processor>
public void process(Exchange exchange) throws Exception
Processor
process
in interface Processor
exchange
- the message exchange
Exception
- if an internal processing error has occurred.protected String isCompleted(String key, Exchange exchange)
key
- the correlation keyexchange
- the incoming exchange
protected Exchange onAggregation(Exchange oldExchange, Exchange newExchange)
protected void onCompletion(String key, Exchange exchange, boolean fromTimeout)
public Predicate getCompletionPredicate()
public void setCompletionPredicate(Predicate completionPredicate)
public boolean isEagerCheckCompletion()
public void setEagerCheckCompletion(boolean eagerCheckCompletion)
public long getCompletionTimeout()
public void setCompletionTimeout(long completionTimeout)
public Expression getCompletionTimeoutExpression()
public void setCompletionTimeoutExpression(Expression completionTimeoutExpression)
public long getCompletionInterval()
public void setCompletionInterval(long completionInterval)
public int getCompletionSize()
public void setCompletionSize(int completionSize)
public Expression getCompletionSizeExpression()
public void setCompletionSizeExpression(Expression completionSizeExpression)
public boolean isIgnoreInvalidCorrelationKeys()
public void setIgnoreInvalidCorrelationKeys(boolean ignoreInvalidCorrelationKeys)
public Integer getCloseCorrelationKeyOnCompletion()
public void setCloseCorrelationKeyOnCompletion(Integer closeCorrelationKeyOnCompletion)
public boolean isCompletionFromBatchConsumer()
public void setCompletionFromBatchConsumer(boolean completionFromBatchConsumer)
public ExceptionHandler getExceptionHandler()
public void setExceptionHandler(ExceptionHandler exceptionHandler)
public boolean isParallelProcessing()
public void setParallelProcessing(boolean parallelProcessing)
public AggregationRepository getAggregationRepository()
public void setAggregationRepository(AggregationRepository aggregationRepository)
public boolean isDiscardOnCompletionTimeout()
public void setDiscardOnCompletionTimeout(boolean discardOnCompletionTimeout)
protected void doStart() throws Exception
doStart
in class ServiceSupport
Exception
protected void doStop() throws Exception
doStop
in class ServiceSupport
Exception
protected void doShutdown() throws Exception
ServiceSupport
doShutdown
in class ServiceSupport
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |