public class AggregateDefinition extends ProcessorDefinition<AggregateDefinition> implements ExecutorServiceAwareDefinition<AggregateDefinition>
inheritErrorHandler, log
Constructor and Description |
---|
AggregateDefinition() |
AggregateDefinition(Expression correlationExpression) |
AggregateDefinition(Expression correlationExpression,
AggregationStrategy aggregationStrategy) |
AggregateDefinition(ExpressionDefinition correlationExpression) |
AggregateDefinition(Predicate predicate) |
Modifier and Type | Method and Description |
---|---|
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 |
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.
|
protected 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)
Setting the executor service for executing
|
AggregateDefinition |
executorServiceRef(String executorServiceRef)
Setting the executor service for executing
|
AggregateDefinition |
forceCompletionOnStop()
Sets the force completion on stop flag, which considers the current group as complete
and sends out the aggregated exchange when the stop event is executed
|
AggregationRepository |
getAggregationRepository() |
String |
getAggregationRepositoryRef() |
AggregationStrategy |
getAggregationStrategy() |
String |
getAggregationStrategyMethodName() |
String |
getAggregationStrategyRef() |
Integer |
getCloseCorrelationKeyOnCompletion() |
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() |
String |
getShortName()
Returns a short name for this node which can be useful for ID generation or referring to related resources like images
|
Boolean |
getStrategyMethodAllowNull() |
String |
getStrategyMethodName() |
String |
getStrategyRef() |
ScheduledExecutorService |
getTimeoutCheckerExecutorService() |
String |
getTimeoutCheckerExecutorServiceRef() |
AggregateDefinition |
groupExchanges()
Enables grouped exchanges, so the aggregator will group all aggregated exchanges into a single
combined Exchange holding all the aggregated exchanges in a
List . |
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 |
isCompletionFromBatchConsumer() |
boolean |
isDiscardOnCompletionTimeout() |
boolean |
isEagerCheckCompletion() |
boolean |
isForceCompletionOnStop() |
boolean |
isGroupExchanges() |
boolean |
isIgnoreInvalidCorrelationKeys() |
boolean |
isOptimisticLocking() |
boolean |
isOutputSupported() |
boolean |
isParallelProcessing() |
AggregateDefinition |
optimisticLocking() |
AggregateDefinition |
optimisticLockRetryPolicy(OptimisticLockRetryPolicy policy) |
AggregateDefinition |
parallelProcessing()
Sending the aggregated output in parallel
|
void |
setAggregationRepository(AggregationRepository aggregationRepository) |
void |
setAggregationRepositoryRef(String aggregationRepositoryRef) |
void |
setAggregationStrategy(AggregationStrategy aggregationStrategy) |
void |
setAggregationStrategyMethodName(String strategyMethodName) |
void |
setAggregationStrategyRef(String aggregationStrategyRef) |
void |
setCloseCorrelationKeyOnCompletion(Integer closeCorrelationKeyOnCompletion) |
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) |
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) |
void |
setStrategyMethodName(String strategyMethodName) |
void |
setStrategyRef(String strategyRef) |
void |
setTimeoutCheckerExecutorService(ScheduledExecutorService timeoutCheckerExecutorService) |
void |
setTimeoutCheckerExecutorServiceRef(String timeoutCheckerExecutorServiceRef) |
AggregateDefinition |
timeoutCheckerExecutorService(ScheduledExecutorService executorService) |
AggregateDefinition |
timeoutCheckerExecutorServiceRef(String executorServiceRef) |
String |
toString() |
addInterceptStrategies, addInterceptStrategy, addOutput, addRoutes, aggregate, aggregate, aggregate, aggregate, aop, attribute, bean, bean, bean, bean, beanRef, beanRef, beanRef, beanRef, choice, clearOutput, convertBodyTo, convertBodyTo, createChannel, createChildProcessor, createCompositeProcessor, createOutputsProcessor, createOutputsProcessor, createProcessor, delay, delay, delay, doTry, dynamicRouter, dynamicRouter, end, endChoice, endDoTry, endParent, enrich, enrich, 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, makeProcessor, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onCompletion, onException, onException, pipeline, pipeline, pipeline, pipeline, placeholder, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichRef, preCreateProcessor, process, processRef, recipientList, recipientList, recipientList, recipientList, removeFaultHeader, removeHeader, removeHeaders, removeHeaders, removeProperty, resequence, resequence, resolveKnownConstantFields, resolvePropertyPlaceholders, rollback, rollback, routeId, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, sample, sample, sample, 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, to, to, to, to, to, to, to, to, to, to, toF, transacted, transacted, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wrapChannel, wrapInErrorHandler, wrapProcessor
description, getDescription, getDescriptionText, getId, hasCustomIdAssigned, idOrCreate, isCustomId, setCustomId, setDescription, setId
public AggregateDefinition()
public AggregateDefinition(Predicate predicate)
public AggregateDefinition(Expression correlationExpression)
public AggregateDefinition(ExpressionDefinition correlationExpression)
public AggregateDefinition(Expression correlationExpression, AggregationStrategy aggregationStrategy)
protected String description()
public String getShortName()
OptionalIdentifiedDefinition
getShortName
in interface NamedNode
getShortName
in class OptionalIdentifiedDefinition<AggregateDefinition>
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
protected 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 getAggregationStrategyMethodName()
public void setAggregationStrategyMethodName(String strategyMethodName)
public Boolean getStrategyMethodAllowNull()
public void setStrategyMethodAllowNull(Boolean strategyMethodAllowNull)
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 boolean isGroupExchanges()
public void setGroupExchanges(Boolean groupExchanges)
public Boolean getCompletionFromBatchConsumer()
public boolean isCompletionFromBatchConsumer()
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 isOptimisticLocking()
public Boolean getParallelProcessing()
public boolean isParallelProcessing()
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 String getStrategyRef()
public void setStrategyRef(String strategyRef)
public String getStrategyMethodName()
public void setStrategyMethodName(String strategyMethodName)
public Boolean getEagerCheckCompletion()
public boolean isEagerCheckCompletion()
public void setEagerCheckCompletion(Boolean eagerCheckCompletion)
public Boolean getIgnoreInvalidCorrelationKeys()
public boolean isIgnoreInvalidCorrelationKeys()
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 boolean isDiscardOnCompletionTimeout()
public void setDiscardOnCompletionTimeout(Boolean discardOnCompletionTimeout)
public void setTimeoutCheckerExecutorService(ScheduledExecutorService timeoutCheckerExecutorService)
public ScheduledExecutorService getTimeoutCheckerExecutorService()
public void setTimeoutCheckerExecutorServiceRef(String timeoutCheckerExecutorServiceRef)
public String getTimeoutCheckerExecutorServiceRef()
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 registrypublic AggregateDefinition groupExchanges()
List
.public AggregateDefinition completionPredicate(Predicate predicate)
predicate
- the predicatepublic AggregateDefinition forceCompletionOnStop()
public Boolean getForceCompletionOnStop()
public boolean isForceCompletionOnStop()
public void setForceCompletionOnStop(Boolean forceCompletionOnStop)
public AggregateDefinition parallelProcessing()
public AggregateDefinition optimisticLocking()
public AggregateDefinition optimisticLockRetryPolicy(OptimisticLockRetryPolicy policy)
public AggregateDefinition executorService(ExecutorService executorService)
ExecutorServiceAwareDefinition
executorService
in interface ExecutorServiceAwareDefinition<AggregateDefinition>
executorService
- the executor servicepublic AggregateDefinition executorServiceRef(String executorServiceRef)
ExecutorServiceAwareDefinition
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)
protected void checkNoCompletedPredicate()
public void setCorrelationExpression(ExpressionSubElementDefinition correlationExpression)
public ExpressionSubElementDefinition getCorrelationExpression()
public ExpressionDefinition getExpression()
public void setExpression(ExpressionDefinition expression)
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