@Metadata(label="eip,routing") public class AggregateDefinition extends ProcessorDefinition<AggregateDefinition> implements ExecutorServiceAwareDefinition<AggregateDefinition>
inheritErrorHandler, log
Constructor and Description |
---|
AggregateDefinition() |
AggregateDefinition(Expression expression) |
AggregateDefinition(Expression correlationExpression,
AggregationStrategy aggregationStrategy) |
AggregateDefinition(ExpressionDefinition correlationExpression) |
AggregateDefinition(Predicate predicate) |
Modifier and Type | Method and Description |
---|---|
AggregateDefinition |
aggregateController(AggregateController aggregateController)
To use a
AggregateController to allow external sources to control
this aggregator. |
AggregateDefinition |
aggregationRepository(AggregationRepository aggregationRepository)
Sets the custom aggregate repository to use.
|
AggregateDefinition |
aggregationRepositoryRef(String aggregationRepositoryRef)
Sets the custom aggregate repository to use
Will by default use
MemoryAggregationRepository |
AggregateDefinition |
aggregationStrategy(AggregationStrategy aggregationStrategy)
Sets the aggregate strategy to use
|
AggregateDefinition |
aggregationStrategyMethodAllowNull()
Sets allowing null when using a POJO as
AggregationStrategy . |
AggregateDefinition |
aggregationStrategyMethodName(String methodName)
Sets the method name to use when using a POJO as
AggregationStrategy . |
AggregateDefinition |
aggregationStrategyRef(String aggregationStrategyRef)
Sets the aggregate strategy to use
|
protected void |
checkNoCompletedPredicate() |
AggregateDefinition |
closeCorrelationKeyOnCompletion(int capacity)
Closes a correlation key when its complete.
|
AggregateDefinition |
completeAllOnStop()
Indicates to wait to complete all current and partial (pending) aggregated exchanges when the context is stopped.
|
AggregateDefinition |
completionFromBatchConsumer()
Enables the batch completion mode where we aggregate from a
BatchConsumer
and aggregate the total number of exchanges the BatchConsumer has reported
as total by checking the exchange property Exchange.BATCH_COMPLETE when its complete. |
AggregateDefinition |
completionInterval(long completionInterval)
Sets the completion interval, which would cause the aggregate to consider the group as complete
and send out the aggregated exchange.
|
AggregateDefinition |
completionPredicate(Predicate predicate)
Sets the predicate used to determine if the aggregation is completed
|
AggregateDefinition |
completionSize(Expression completionSize)
Sets the completion size, which is the number of aggregated exchanges which would
cause the aggregate to consider the group as complete and send out the aggregated exchange.
|
AggregateDefinition |
completionSize(int completionSize)
Sets the completion size, which is the number of aggregated exchanges which would
cause the aggregate to consider the group as complete and send out the aggregated exchange.
|
AggregateDefinition |
completionTimeout(Expression completionTimeout)
Sets the completion timeout, which would cause the aggregate to consider the group as complete
and send out the aggregated exchange.
|
AggregateDefinition |
completionTimeout(long completionTimeout)
Sets the completion timeout, which would cause the aggregate to consider the group as complete
and send out the aggregated exchange.
|
void |
configureChild(ProcessorDefinition<?> output)
Strategy for children to do any custom configuration
|
protected AggregateProcessor |
createAggregator(RouteContext routeContext) |
Processor |
createProcessor(RouteContext routeContext)
Override this in definition class and implement logic to create the processor
based on the definition model.
|
protected String |
description() |
AggregateDefinition |
discardOnCompletionTimeout()
Discards the aggregated message on completion timeout.
|
AggregateDefinition |
eagerCheckCompletion()
Use eager completion checking which means that the {{completionPredicate}} will use the incoming Exchange.
|
AggregateDefinition |
executorService(ExecutorService executorService)
If using parallelProcessing you can specify a custom thread pool to be used.
|
AggregateDefinition |
executorServiceRef(String executorServiceRef)
If using parallelProcessing you can specify a custom thread pool to be used.
|
AggregateDefinition |
forceCompletionOnStop()
Indicates to complete all current aggregated exchanges when the context is stopped
|
AggregateController |
getAggregateController() |
String |
getAggregateControllerRef() |
AggregationRepository |
getAggregationRepository() |
String |
getAggregationRepositoryRef() |
AggregationStrategy |
getAggregationStrategy() |
String |
getAggregationStrategyMethodName() |
String |
getAggregationStrategyRef() |
Integer |
getCloseCorrelationKeyOnCompletion() |
Boolean |
getCompleteAllOnStop() |
Boolean |
getCompletionFromBatchConsumer() |
Long |
getCompletionInterval() |
ExpressionSubElementDefinition |
getCompletionPredicate() |
Integer |
getCompletionSize() |
ExpressionSubElementDefinition |
getCompletionSizeExpression() |
Long |
getCompletionTimeout() |
ExpressionSubElementDefinition |
getCompletionTimeoutExpression() |
ExpressionSubElementDefinition |
getCorrelationExpression() |
Boolean |
getDiscardOnCompletionTimeout() |
Boolean |
getEagerCheckCompletion() |
ExecutorService |
getExecutorService()
Gets the executor service
|
String |
getExecutorServiceRef()
Gets the reference to lookup in the
Registry for the executor service to be used. |
ExpressionDefinition |
getExpression() |
Boolean |
getForceCompletionOnStop() |
Boolean |
getGroupExchanges() |
Boolean |
getIgnoreInvalidCorrelationKeys() |
String |
getLabel()
Returns a label to describe this node such as the expression if some kind of expression node
|
Boolean |
getOptimisticLocking() |
OptimisticLockRetryPolicy |
getOptimisticLockRetryPolicy() |
OptimisticLockRetryPolicyDefinition |
getOptimisticLockRetryPolicyDefinition() |
List<ProcessorDefinition<?>> |
getOutputs() |
Boolean |
getParallelProcessing() |
Boolean |
getStrategyMethodAllowNull() |
String |
getStrategyMethodName() |
String |
getStrategyRef() |
ScheduledExecutorService |
getTimeoutCheckerExecutorService() |
String |
getTimeoutCheckerExecutorServiceRef() |
AggregateDefinition |
groupExchanges()
Deprecated.
use
GroupedExchangeAggregationStrategy as aggregation strategy instead. |
AggregateDefinition |
ignoreInvalidCorrelationKeys()
If a correlation key cannot be successfully evaluated it will be ignored by logging a {{DEBUG}} and then just
ignore the incoming Exchange.
|
boolean |
isOutputSupported() |
AggregateDefinition |
optimisticLocking()
Turns on using optimistic locking, which requires the aggregationRepository being used,
is supporting this by implementing
OptimisticLockingAggregationRepository . |
AggregateDefinition |
optimisticLockRetryPolicy(OptimisticLockRetryPolicy policy)
Allows to configure retry settings when using optimistic locking.
|
AggregateDefinition |
parallelProcessing()
When aggregated are completed they are being send out of the aggregator.
|
AggregateDefinition |
parallelProcessing(boolean parallelProcessing)
When aggregated are completed they are being send out of the aggregator.
|
void |
setAggregateController(AggregateController aggregateController) |
void |
setAggregateControllerRef(String aggregateControllerRef)
To use a
AggregateController to allow external sources to control
this aggregator. |
void |
setAggregationRepository(AggregationRepository aggregationRepository) |
void |
setAggregationRepositoryRef(String aggregationRepositoryRef) |
void |
setAggregationStrategy(AggregationStrategy aggregationStrategy)
The AggregationStrategy to use.
|
void |
setAggregationStrategyMethodName(String strategyMethodName)
This option can be used to explicit declare the method name to use, when using POJOs as the AggregationStrategy.
|
void |
setAggregationStrategyRef(String aggregationStrategyRef)
A reference to lookup the AggregationStrategy in the Registry.
|
void |
setCloseCorrelationKeyOnCompletion(Integer closeCorrelationKeyOnCompletion) |
void |
setCompleteAllOnStop(Boolean completeAllOnStop) |
void |
setCompletionFromBatchConsumer(Boolean completionFromBatchConsumer) |
void |
setCompletionInterval(Long completionInterval) |
void |
setCompletionPredicate(ExpressionSubElementDefinition completionPredicate) |
void |
setCompletionSize(Integer completionSize) |
void |
setCompletionSizeExpression(ExpressionSubElementDefinition completionSizeExpression) |
void |
setCompletionTimeout(Long completionTimeout) |
void |
setCompletionTimeoutExpression(ExpressionSubElementDefinition completionTimeoutExpression) |
void |
setCorrelationExpression(ExpressionSubElementDefinition correlationExpression)
The expression used to calculate the correlation key to use for aggregation.
|
void |
setDiscardOnCompletionTimeout(Boolean discardOnCompletionTimeout) |
void |
setEagerCheckCompletion(Boolean eagerCheckCompletion) |
void |
setExecutorService(ExecutorService executorService)
Sets the executor service to be used.
|
void |
setExecutorServiceRef(String executorServiceRef)
Sets a reference to lookup in the
Registry for the executor service to be used. |
void |
setExpression(ExpressionDefinition expression) |
void |
setForceCompletionOnStop(Boolean forceCompletionOnStop) |
void |
setGroupExchanges(Boolean groupExchanges) |
void |
setIgnoreInvalidCorrelationKeys(Boolean ignoreInvalidCorrelationKeys) |
void |
setOptimisticLocking(boolean optimisticLocking) |
void |
setOptimisticLockRetryPolicy(OptimisticLockRetryPolicy optimisticLockRetryPolicy) |
void |
setOptimisticLockRetryPolicyDefinition(OptimisticLockRetryPolicyDefinition optimisticLockRetryPolicyDefinition) |
void |
setOutputs(List<ProcessorDefinition<?>> outputs) |
void |
setParallelProcessing(boolean parallelProcessing) |
void |
setStrategyMethodAllowNull(Boolean strategyMethodAllowNull)
If this option is false then the aggregate method is not used for the very first aggregation.
|
void |
setStrategyMethodName(String strategyMethodName)
This option can be used to explicit declare the method name to use, when using POJOs as the AggregationStrategy.
|
void |
setStrategyRef(String strategyRef)
A reference to lookup the AggregationStrategy in the Registry.
|
void |
setTimeoutCheckerExecutorService(ScheduledExecutorService timeoutCheckerExecutorService) |
void |
setTimeoutCheckerExecutorServiceRef(String timeoutCheckerExecutorServiceRef) |
AggregateDefinition |
timeoutCheckerExecutorService(ScheduledExecutorService executorService)
If using either of the completionTimeout, completionTimeoutExpression, or completionInterval options a
background thread is created to check for the completion for every aggregator.
|
AggregateDefinition |
timeoutCheckerExecutorServiceRef(String executorServiceRef)
If using either of the completionTimeout, completionTimeoutExpression, or completionInterval options a
background thread is created to check for the completion for every aggregator.
|
String |
toString() |
addInterceptStrategies, addInterceptStrategy, addOutput, addRoutes, aggregate, aggregate, aggregate, aggregate, aop, attribute, bean, bean, bean, bean, bean, bean, bean, bean, beanRef, beanRef, beanRef, beanRef, beanRef, choice, clearOutput, convertBodyTo, convertBodyTo, createChannel, createChildProcessor, createCompositeProcessor, createOutputsProcessor, createOutputsProcessor, createOutputsProcessorImpl, createProcessor, delay, delay, delay, doTry, dynamicRouter, dynamicRouter, end, endChoice, endDoTry, endParent, endRest, enrich, enrich, enrich, enrich, enrich, enrichRef, enrichRef, enrichRef, filter, filter, filter, filter, getIndex, getInterceptStrategies, getOtherAttributes, getParent, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, inOnly, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, inOut, isAbstract, isInheritErrorHandler, isTopLevelOnly, loadBalance, loadBalance, log, log, log, log, log, log, loop, loop, loop, loopDoWhile, makeProcessor, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onCompletion, onException, onException, pipeline, pipeline, pipeline, pipeline, placeholder, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichRef, pollEnrichRef, preCreateProcessor, process, process, processRef, recipientList, recipientList, recipientList, recipientList, removeFaultHeader, removeHeader, removeHeaders, removeHeaders, removeProperties, removeProperties, removeProperty, resequence, resequence, rollback, rollback, routeDescription, routeId, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, sample, sample, sample, script, script, setBody, setBody, setExchangePattern, setFaultBody, setFaultHeader, setHeader, setHeader, setInheritErrorHandler, setOtherAttributes, setOutHeader, setOutHeader, setParent, setProperty, setProperty, sort, sort, sort, split, split, split, startupOrder, stop, threads, threads, threads, threads, throttle, throttle, throwException, throwException, to, to, to, to, to, to, to, to, to, to, toD, toD, toF, transacted, transacted, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wrapChannel, wrapChannel, wrapInErrorHandler, wrapProcessor
description, description, getCustomId, getDescription, getDescriptionText, getId, getShortName, hasCustomIdAssigned, idOrCreate, setCustomId, setDescription, setId
public AggregateDefinition()
public AggregateDefinition(Predicate predicate)
public AggregateDefinition(Expression expression)
public AggregateDefinition(ExpressionDefinition correlationExpression)
public AggregateDefinition(Expression correlationExpression, AggregationStrategy aggregationStrategy)
protected String description()
public String getLabel()
ProcessorDefinition
getLabel
in interface NamedNode
getLabel
in class ProcessorDefinition<AggregateDefinition>
public Processor createProcessor(RouteContext routeContext) throws Exception
ProcessorDefinition
createProcessor
in class ProcessorDefinition<AggregateDefinition>
Exception
protected AggregateProcessor createAggregator(RouteContext routeContext) throws Exception
Exception
public void configureChild(ProcessorDefinition<?> output)
ProcessorDefinition
configureChild
in class ProcessorDefinition<AggregateDefinition>
output
- the child to be added as output to thispublic AggregationStrategy getAggregationStrategy()
public void setAggregationStrategy(AggregationStrategy aggregationStrategy)
public String getAggregationStrategyRef()
public void setAggregationStrategyRef(String aggregationStrategyRef)
public String getStrategyRef()
public void setStrategyRef(String strategyRef)
public String getAggregationStrategyMethodName()
public void setAggregationStrategyMethodName(String strategyMethodName)
public Boolean getStrategyMethodAllowNull()
public String getStrategyMethodName()
public void setStrategyMethodName(String strategyMethodName)
public void setStrategyMethodAllowNull(Boolean strategyMethodAllowNull)
public void setCorrelationExpression(ExpressionSubElementDefinition correlationExpression)
public ExpressionSubElementDefinition getCorrelationExpression()
public Integer getCompletionSize()
public void setCompletionSize(Integer completionSize)
public OptimisticLockRetryPolicyDefinition getOptimisticLockRetryPolicyDefinition()
public void setOptimisticLockRetryPolicyDefinition(OptimisticLockRetryPolicyDefinition optimisticLockRetryPolicyDefinition)
public OptimisticLockRetryPolicy getOptimisticLockRetryPolicy()
public void setOptimisticLockRetryPolicy(OptimisticLockRetryPolicy optimisticLockRetryPolicy)
public Long getCompletionInterval()
public void setCompletionInterval(Long completionInterval)
public Long getCompletionTimeout()
public void setCompletionTimeout(Long completionTimeout)
public ExpressionSubElementDefinition getCompletionPredicate()
public void setCompletionPredicate(ExpressionSubElementDefinition completionPredicate)
public ExpressionSubElementDefinition getCompletionTimeoutExpression()
public void setCompletionTimeoutExpression(ExpressionSubElementDefinition completionTimeoutExpression)
public ExpressionSubElementDefinition getCompletionSizeExpression()
public void setCompletionSizeExpression(ExpressionSubElementDefinition completionSizeExpression)
public Boolean getGroupExchanges()
public void setGroupExchanges(Boolean groupExchanges)
public Boolean getCompletionFromBatchConsumer()
public void setCompletionFromBatchConsumer(Boolean completionFromBatchConsumer)
public ExecutorService getExecutorService()
ExecutorServiceAware
getExecutorService
in interface ExecutorServiceAware
public void setExecutorService(ExecutorService executorService)
ExecutorServiceAware
setExecutorService
in interface ExecutorServiceAware
executorService
- the executorpublic Boolean getOptimisticLocking()
public void setOptimisticLocking(boolean optimisticLocking)
public Boolean getParallelProcessing()
public void setParallelProcessing(boolean parallelProcessing)
public String getExecutorServiceRef()
ExecutorServiceAware
Registry
for the executor service to be used.getExecutorServiceRef
in interface ExecutorServiceAware
public void setExecutorServiceRef(String executorServiceRef)
ExecutorServiceAware
Registry
for the executor service to be used.setExecutorServiceRef
in interface ExecutorServiceAware
executorServiceRef
- reference for the executorpublic Boolean getEagerCheckCompletion()
public void setEagerCheckCompletion(Boolean eagerCheckCompletion)
public Boolean getIgnoreInvalidCorrelationKeys()
public void setIgnoreInvalidCorrelationKeys(Boolean ignoreInvalidCorrelationKeys)
public Integer getCloseCorrelationKeyOnCompletion()
public void setCloseCorrelationKeyOnCompletion(Integer closeCorrelationKeyOnCompletion)
public AggregationRepository getAggregationRepository()
public void setAggregationRepository(AggregationRepository aggregationRepository)
public String getAggregationRepositoryRef()
public void setAggregationRepositoryRef(String aggregationRepositoryRef)
public Boolean getDiscardOnCompletionTimeout()
public void setDiscardOnCompletionTimeout(Boolean discardOnCompletionTimeout)
public void setTimeoutCheckerExecutorService(ScheduledExecutorService timeoutCheckerExecutorService)
public ScheduledExecutorService getTimeoutCheckerExecutorService()
public void setTimeoutCheckerExecutorServiceRef(String timeoutCheckerExecutorServiceRef)
public String getTimeoutCheckerExecutorServiceRef()
public Boolean getForceCompletionOnStop()
public void setForceCompletionOnStop(Boolean forceCompletionOnStop)
public Boolean getCompleteAllOnStop()
public void setCompleteAllOnStop(Boolean completeAllOnStop)
public AggregateController getAggregateController()
public void setAggregateController(AggregateController aggregateController)
public String getAggregateControllerRef()
public void setAggregateControllerRef(String aggregateControllerRef)
AggregateController
to allow external sources to control
this aggregator.public AggregateDefinition eagerCheckCompletion()
public AggregateDefinition ignoreInvalidCorrelationKeys()
public AggregateDefinition closeCorrelationKeyOnCompletion(int capacity)
ClosedCorrelationKeyException
is thrown.capacity
- the maximum capacity of the closed correlation key cache.
Use 0 or negative value for unbounded capacity.public AggregateDefinition discardOnCompletionTimeout()
public AggregateDefinition completionFromBatchConsumer()
BatchConsumer
and aggregate the total number of exchanges the BatchConsumer
has reported
as total by checking the exchange property Exchange.BATCH_COMPLETE
when its complete.public AggregateDefinition completionSize(int completionSize)
completionSize
- the completion sizepublic AggregateDefinition completionSize(Expression completionSize)
completionSize
- the completion size as an Expression
which is evaluated as a Integer
typepublic AggregateDefinition completionInterval(long completionInterval)
completionInterval
- the interval in millispublic AggregateDefinition completionTimeout(long completionTimeout)
completionTimeout
- the timeout in millispublic AggregateDefinition completionTimeout(Expression completionTimeout)
completionTimeout
- the timeout as an Expression
which is evaluated as a Long
typepublic AggregateDefinition aggregationStrategy(AggregationStrategy aggregationStrategy)
aggregationStrategy
- the aggregate strategy to usepublic AggregateDefinition aggregationStrategyRef(String aggregationStrategyRef)
aggregationStrategyRef
- reference to the strategy to lookup in the registrypublic AggregateDefinition aggregationStrategyMethodName(String methodName)
AggregationStrategy
.methodName
- the method name to callpublic AggregateDefinition aggregationStrategyMethodAllowNull()
AggregationStrategy
.public AggregateDefinition aggregationRepository(AggregationRepository aggregationRepository)
MemoryAggregationRepository
aggregationRepository
- the aggregate repository to usepublic AggregateDefinition aggregationRepositoryRef(String aggregationRepositoryRef)
MemoryAggregationRepository
aggregationRepositoryRef
- reference to the repository to lookup in the registry@Deprecated public AggregateDefinition groupExchanges()
GroupedExchangeAggregationStrategy
as aggregation strategy instead.List
.public AggregateDefinition completionPredicate(Predicate predicate)
public AggregateDefinition forceCompletionOnStop()
public AggregateDefinition completeAllOnStop()
public AggregateDefinition parallelProcessing()
public AggregateDefinition parallelProcessing(boolean parallelProcessing)
public AggregateDefinition optimisticLocking()
OptimisticLockingAggregationRepository
.public AggregateDefinition optimisticLockRetryPolicy(OptimisticLockRetryPolicy policy)
public AggregateDefinition executorService(ExecutorService executorService)
executorService
in interface ExecutorServiceAwareDefinition<AggregateDefinition>
executorService
- the executor servicepublic AggregateDefinition executorServiceRef(String executorServiceRef)
executorServiceRef
in interface ExecutorServiceAwareDefinition<AggregateDefinition>
executorServiceRef
- reference for a ExecutorService
to lookup in the Registry
public AggregateDefinition timeoutCheckerExecutorService(ScheduledExecutorService executorService)
public AggregateDefinition timeoutCheckerExecutorServiceRef(String executorServiceRef)
public AggregateDefinition aggregateController(AggregateController aggregateController)
AggregateController
to allow external sources to control
this aggregator.public ExpressionDefinition getExpression()
public void setExpression(ExpressionDefinition expression)
protected void checkNoCompletedPredicate()
public List<ProcessorDefinition<?>> getOutputs()
getOutputs
in class ProcessorDefinition<AggregateDefinition>
public boolean isOutputSupported()
isOutputSupported
in class ProcessorDefinition<AggregateDefinition>
public void setOutputs(List<ProcessorDefinition<?>> outputs)
Apache Camel