Package org.apache.camel.model
Class AggregateDefinition
java.lang.Object
org.apache.camel.model.OptionalIdentifiedDefinition<AggregateDefinition>
org.apache.camel.model.ProcessorDefinition<AggregateDefinition>
org.apache.camel.model.OutputDefinition<AggregateDefinition>
org.apache.camel.model.AggregateDefinition
- All Implemented Interfaces:
org.apache.camel.CamelContextAware
,org.apache.camel.LineNumberAware
,AggregationStrategyAwareDefinition<AggregateDefinition>
,Block
,ExecutorServiceAwareDefinition<AggregateDefinition>
,OutputNode
,org.apache.camel.NamedNode
,org.apache.camel.spi.HasCamelContext
,org.apache.camel.spi.HasId
,org.apache.camel.spi.IdAware
@Metadata(label="eip,routing")
public class AggregateDefinition
extends OutputDefinition<AggregateDefinition>
implements ExecutorServiceAwareDefinition<AggregateDefinition>, AggregationStrategyAwareDefinition<AggregateDefinition>
Aggregates many messages into a single message
-
Field Summary
Fields inherited from class org.apache.camel.model.OutputDefinition
outputs
Fields inherited from class org.apache.camel.model.ProcessorDefinition
disabled, inheritErrorHandler
-
Constructor Summary
ConstructorDescriptionAggregateDefinition
(org.apache.camel.Expression expression) AggregateDefinition
(org.apache.camel.Expression correlationExpression, org.apache.camel.AggregationStrategy aggregationStrategy) AggregateDefinition
(ExpressionDefinition correlationExpression) AggregateDefinition
(org.apache.camel.Predicate predicate) -
Method Summary
Modifier and TypeMethodDescriptionaggregateController
(String aggregateController) To use aAggregateController
to allow external sources to control this aggregator.aggregateController
(org.apache.camel.processor.aggregate.AggregateController aggregateController) To use aAggregateController
to allow external sources to control this aggregator.aggregationRepository
(String aggregationRepository) Sets the custom aggregate repository to use.aggregationRepository
(org.apache.camel.spi.AggregationRepository aggregationRepository) Sets the custom aggregate repository to use.Sets the AggregationStrategy to use with a fluent builder.aggregationStrategy
(String aggregationStrategy) Sets the aggregate strategy to useaggregationStrategy
(org.apache.camel.AggregationStrategy aggregationStrategy) Sets the aggregate strategy to useSets allowing null when using a bean asAggregationStrategy
.aggregationStrategyMethodName
(String methodName) Sets the method name to use when using a bean asAggregationStrategy
.protected void
closeCorrelationKeyOnCompletion
(int capacity) Closes a correlation key when its complete.Indicates to wait to complete all current and partial (pending) aggregated exchanges when the context is stopped.A Predicate to indicate when an aggregated exchange is complete.completion
(org.apache.camel.Predicate predicate) A Predicate to indicate when an aggregated exchange is complete.Enables the batch completion mode where we aggregate from aBatchConsumer
and aggregate the total number of exchanges theBatchConsumer
has reported as total by checking the exchange propertyExchange.BATCH_COMPLETE
when its complete.completionInterval
(long completionInterval) A repeating period in millis by which the aggregator will complete all current aggregated exchanges.completionInterval
(String completionInterval) A repeating period in millis by which the aggregator will complete all current aggregated exchanges.Enables completion on all previous groups when a new incoming correlation group.A Predicate to indicate when an aggregated exchange is complete.completionPredicate
(org.apache.camel.Predicate predicate) A Predicate to indicate when an aggregated exchange is complete.completionSize
(int completionSize) Number of messages aggregated before the aggregation is complete.completionSize
(String completionSize) Number of messages aggregated before the aggregation is complete.completionSize
(org.apache.camel.Expression completionSize) Number of messages aggregated before the aggregation is complete.completionTimeout
(long completionTimeout) Time in millis that an aggregated exchange should be inactive before its complete (timeout).completionTimeout
(String completionTimeout) Time in millis that an aggregated exchange should be inactive before its complete (timeout).completionTimeout
(org.apache.camel.Expression completionTimeout) Time in millis that an aggregated exchange should be inactive before its complete (timeout).completionTimeoutCheckerInterval
(long completionTimeoutCheckerInterval) Interval in millis that is used by the background task that checks for timeouts (TimeoutMap
).void
configureChild
(ProcessorDefinition<?> output) Strategy for children to do any custom configurationprotected String
Discards the aggregated message when aggregation failed (an exception was thrown fromAggregationStrategy
.Discards the aggregated message on completion timeout.Use eager completion checking which means that the completionPredicate will use the incoming Exchange.executorService
(String executorService) If using parallelProcessing you can specify a custom thread pool to be used.executorService
(ExecutorService executorService) If using parallelProcessing you can specify a custom thread pool to be used.Indicates to complete all current aggregated exchanges when the context is stoppedorg.apache.camel.processor.aggregate.AggregateController
org.apache.camel.spi.AggregationRepository
org.apache.camel.AggregationStrategy
Gets the aggregation strategyIf this option is false then the aggregate method is not used for the very first aggregation.This option can be used to explicit declare the method name to use, when using beans as the AggregationStrategy.Gets a reference id to lookup the aggregation strategy from the registryGets the executor service for executingGets a reference id to lookup the executor service from the registrygetLabel()
Returns a label to describe this node such as the expression if some kind of expression nodeorg.apache.camel.processor.aggregate.OptimisticLockRetryPolicy
If a correlation key cannot be successfully evaluated it will be ignored by logging a DEBUG and then just ignore the incoming Exchange.Turns on using optimistic locking, which requires the aggregationRepository being used, is supporting this by implementingOptimisticLockingAggregationRepository
.optimisticLockRetryPolicy
(org.apache.camel.processor.aggregate.OptimisticLockRetryPolicy policy) Allows to configure retry settings when using optimistic locking.When aggregated are completed they are being send out of the aggregator.parallelProcessing
(boolean parallelProcessing) When aggregated are completed they are being send out of the aggregator.void
setAggregateController
(String aggregateController) To use aAggregateController
to allow external sources to control this aggregator.void
setAggregateController
(org.apache.camel.processor.aggregate.AggregateController aggregateController) void
setAggregationRepository
(String aggregationRepository) The AggregationRepository to use.void
setAggregationRepository
(org.apache.camel.spi.AggregationRepository aggregationRepository) void
setAggregationStrategy
(String aggregationStrategy) The AggregationStrategy to use.void
setAggregationStrategy
(org.apache.camel.AggregationStrategy aggregationStrategy) The AggregationStrategy to use.void
setAggregationStrategyMethodAllowNull
(String aggregationStrategyMethodAllowNull) If this option is false then the aggregate method is not used for the very first aggregation.void
setAggregationStrategyMethodName
(String strategyMethodName) This option can be used to explicit declare the method name to use, when using beans as the AggregationStrategy.void
setCloseCorrelationKeyOnCompletion
(String closeCorrelationKeyOnCompletion) void
setCompleteAllOnStop
(String completeAllOnStop) void
setCompletionFromBatchConsumer
(String completionFromBatchConsumer) void
setCompletionInterval
(String completionInterval) void
setCompletionOnNewCorrelationGroup
(String completionOnNewCorrelationGroup) void
setCompletionPredicate
(ExpressionSubElementDefinition completionPredicate) void
setCompletionSize
(String completionSize) void
setCompletionSizeExpression
(ExpressionSubElementDefinition completionSizeExpression) Number of messages aggregated before the aggregation is complete.void
setCompletionTimeout
(String completionTimeout) void
setCompletionTimeoutCheckerInterval
(String completionTimeoutCheckerInterval) void
setCompletionTimeoutExpression
(ExpressionSubElementDefinition completionTimeoutExpression) Time in millis that an aggregated exchange should be inactive before its complete (timeout).void
setCorrelationExpression
(ExpressionSubElementDefinition correlationExpression) The expression used to calculate the correlation key to use for aggregation.void
setDiscardOnAggregationFailure
(String discardOnAggregationFailure) void
setDiscardOnCompletionTimeout
(String discardOnCompletionTimeout) void
setEagerCheckCompletion
(String eagerCheckCompletion) void
setExecutorService
(String executorService) void
setExpression
(org.apache.camel.Expression expression) void
setExpression
(ExpressionDefinition expression) void
setForceCompletionOnStop
(String forceCompletionOnStop) void
setIgnoreInvalidCorrelationKeys
(String ignoreInvalidCorrelationKeys) void
setOptimisticLocking
(String optimisticLocking) void
setOptimisticLockRetryPolicy
(org.apache.camel.processor.aggregate.OptimisticLockRetryPolicy optimisticLockRetryPolicy) void
setOptimisticLockRetryPolicyDefinition
(OptimisticLockRetryPolicyDefinition optimisticLockRetryPolicyDefinition) void
setOutputs
(List<ProcessorDefinition<?>> outputs) void
setParallelProcessing
(String parallelProcessing) void
setTimeoutCheckerExecutorService
(String timeoutCheckerExecutorService) timeoutCheckerExecutorService
(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.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.toString()
Methods inherited from class org.apache.camel.model.ProcessorDefinition
addInterceptStrategy, addOutput, aggregate, aggregate, aggregate, aggregate, bean, bean, bean, bean, bean, bean, bean, bean, bean, bean, bean, choice, circuitBreaker, claimCheck, claimCheck, claimCheck, claimCheck, clearOutput, convertBodyTo, convertBodyTo, convertBodyTo, convertHeaderTo, convertHeaderTo, convertHeaderTo, convertHeaderTo, convertVariableTo, convertVariableTo, convertVariableTo, convertVariableTo, delay, delay, delay, disabled, disabled, disabled, doTry, dynamicRouter, dynamicRouter, end, endChoice, endCircuitBreaker, endDoCatch, endDoTry, endParent, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrichWith, enrichWith, enrichWith, enrichWith, enrichWith, enrichWith, filter, filter, filter, filter, getDisabled, getIndex, getInterceptStrategies, getParent, getRouteConfiguration, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, isAbstract, isInheritErrorHandler, isTopLevelOnly, isWrappingEntireOutput, kamelet, loadBalance, loadBalance, log, log, log, log, log, log, loop, loop, loop, loopDoWhile, loopDoWhile, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, nodePrefixId, onCompletion, onException, onException, onException, onException, pausable, pausable, pausable, pausable, pipeline, pipeline, pipeline, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, preCreateProcessor, process, process, process, recipientList, recipientList, recipientList, recipientList, removeHeader, removeHeaders, removeHeaders, removeProperties, removeProperties, removeProperty, removeVariable, resequence, resequence, resumable, resumable, resumable, rollback, rollback, routeDescription, routeGroup, routeId, routingSlip, routingSlip, routingSlip, saga, sample, sample, sample, sample, script, script, serviceCall, serviceCall, serviceCall, setBody, setBody, setBody, setDisabled, setExchangePattern, setExchangePattern, setHeader, setHeader, setHeader, setHeaders, setInheritErrorHandler, setParent, setProperty, setProperty, setProperty, setRouteConfiguration, setVariable, setVariable, setVariable, sort, sort, sort, split, split, split, split, startupOrder, step, step, stop, threads, threads, threads, threads, throttle, throttle, throttle, throttle, throttle, throwException, throwException, to, to, to, to, to, to, to, to, to, to, to, to, toD, toD, toD, toD, toD, toD, toD, toD, toD, toF, toV, transacted, transacted, transform, transform, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap, wireTap, wireTap
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, getCamelContext, getCustomId, getDescription, getDescriptionText, getId, getLineNumber, getLocation, getNodePrefixId, hasCustomIdAssigned, idOrCreate, setCamelContext, setCustomId, setDescription, setGeneratedId, setId, setLineNumber, setLocation
-
Constructor Details
-
AggregateDefinition
public AggregateDefinition() -
AggregateDefinition
public AggregateDefinition(@AsPredicate org.apache.camel.Predicate predicate) -
AggregateDefinition
public AggregateDefinition(org.apache.camel.Expression expression) -
AggregateDefinition
-
AggregateDefinition
public AggregateDefinition(org.apache.camel.Expression correlationExpression, org.apache.camel.AggregationStrategy aggregationStrategy)
-
-
Method Details
-
toString
- Overrides:
toString
in classOutputDefinition<AggregateDefinition>
-
description
-
getShortName
- Specified by:
getShortName
in interfaceorg.apache.camel.NamedNode
- Overrides:
getShortName
in classOutputDefinition<AggregateDefinition>
-
getLabel
Description copied from class:ProcessorDefinition
Returns a label to describe this node such as the expression if some kind of expression node- Specified by:
getLabel
in interfaceorg.apache.camel.NamedNode
- Overrides:
getLabel
in classProcessorDefinition<AggregateDefinition>
-
configureChild
Description copied from class:ProcessorDefinition
Strategy for children to do any custom configuration- Overrides:
configureChild
in classProcessorDefinition<AggregateDefinition>
- Parameters:
output
- the child to be added as output to this
-
getAggregationStrategyBean
public org.apache.camel.AggregationStrategy getAggregationStrategyBean()Description copied from interface:AggregationStrategyAwareDefinition
Gets the aggregation strategy- Specified by:
getAggregationStrategyBean
in interfaceAggregationStrategyAwareDefinition<AggregateDefinition>
-
getAggregationRepositoryBean
public org.apache.camel.spi.AggregationRepository getAggregationRepositoryBean() -
getAggregationStrategyRef
Description copied from interface:AggregationStrategyAwareDefinition
Gets a reference id to lookup the aggregation strategy from the registry- Specified by:
getAggregationStrategyRef
in interfaceAggregationStrategyAwareDefinition<AggregateDefinition>
-
getAggregateControllerBean
public org.apache.camel.processor.aggregate.AggregateController getAggregateControllerBean() -
getExecutorServiceBean
Description copied from interface:ExecutorServiceAwareDefinition
Gets the executor service for executing- Specified by:
getExecutorServiceBean
in interfaceExecutorServiceAwareDefinition<AggregateDefinition>
-
getExecutorServiceRef
Description copied from interface:ExecutorServiceAwareDefinition
Gets a reference id to lookup the executor service from the registry- Specified by:
getExecutorServiceRef
in interfaceExecutorServiceAwareDefinition<AggregateDefinition>
-
getTimeoutCheckerExecutorServiceBean
-
getAggregationRepository
-
setAggregationRepository
public void setAggregationRepository(org.apache.camel.spi.AggregationRepository aggregationRepository) -
setAggregationRepository
The AggregationRepository to use. Sets the custom aggregate repository to use. Will by default use org.apache.camel.processor.aggregate.MemoryAggregationRepository -
setAggregationStrategy
public void setAggregationStrategy(org.apache.camel.AggregationStrategy aggregationStrategy) The AggregationStrategy to use. For example to lookup a bean with the name foo, the value is simply just #bean:foo. Configuring an AggregationStrategy is required, and is used to merge the incoming Exchange with the existing already merged exchanges. At first call the oldExchange parameter is null. On subsequent invocations the oldExchange contains the merged exchanges and newExchange is of course the new incoming Exchange. -
getAggregationStrategy
-
setAggregationStrategy
The AggregationStrategy to use. For example to lookup a bean with the name foo, the value is simply just #bean:foo. Configuring an AggregationStrategy is required, and is used to merge the incoming Exchange with the existing already merged exchanges. At first call the oldExchange parameter is null. On subsequent invocations the oldExchange contains the merged exchanges and newExchange is of course the new incoming Exchange. -
getAggregationStrategyMethodName
Description copied from interface:AggregationStrategyAwareDefinition
This option can be used to explicit declare the method name to use, when using beans as the AggregationStrategy.- Specified by:
getAggregationStrategyMethodName
in interfaceAggregationStrategyAwareDefinition<AggregateDefinition>
-
setAggregationStrategyMethodName
This option can be used to explicit declare the method name to use, when using beans as the AggregationStrategy. -
getAggregationStrategyMethodAllowNull
Description copied from interface:AggregationStrategyAwareDefinition
If this option is false then the aggregate method is not used for the very first aggregation. If this option is true then null values is used as the oldExchange (at the very first aggregation), when using beans as the AggregationStrategy.- Specified by:
getAggregationStrategyMethodAllowNull
in interfaceAggregationStrategyAwareDefinition<AggregateDefinition>
-
setAggregationStrategyMethodAllowNull
If this option is false then the aggregate method is not used for the very first aggregation. If this option is true then null values is used as the oldExchange (at the very first aggregation), when using beans as the AggregationStrategy. -
setCorrelationExpression
The expression used to calculate the correlation key to use for aggregation. The Exchange which has the same correlation key is aggregated together. If the correlation key could not be evaluated an Exception is thrown. You can disable this by using the ignoreBadCorrelationKeys option. -
getCorrelationExpression
-
getCompletionSize
-
setCompletionSize
-
getOptimisticLockRetryPolicyDefinition
-
setOptimisticLockRetryPolicyDefinition
public void setOptimisticLockRetryPolicyDefinition(OptimisticLockRetryPolicyDefinition optimisticLockRetryPolicyDefinition) -
getOptimisticLockRetryPolicy
public org.apache.camel.processor.aggregate.OptimisticLockRetryPolicy getOptimisticLockRetryPolicy() -
setOptimisticLockRetryPolicy
public void setOptimisticLockRetryPolicy(org.apache.camel.processor.aggregate.OptimisticLockRetryPolicy optimisticLockRetryPolicy) -
getCompletionInterval
-
setCompletionInterval
-
getCompletionTimeout
-
setCompletionTimeout
-
getCompletionTimeoutCheckerInterval
-
setCompletionTimeoutCheckerInterval
-
getCompletionPredicate
-
setCompletionPredicate
-
getCompletionTimeoutExpression
-
setCompletionTimeoutExpression
public void setCompletionTimeoutExpression(ExpressionSubElementDefinition completionTimeoutExpression) Time in millis that an aggregated exchange should be inactive before its complete (timeout). This option can be set as either a fixed value or using an Expression which allows you to evaluate a timeout dynamically - will use Long as result. If both are set Camel will fallback to use the fixed value if the Expression result was null or 0. You cannot use this option together with completionInterval, only one of the two can be used. By default the timeout checker runs every second, you can use the completionTimeoutCheckerInterval option to configure how frequently to run the checker. The timeout is an approximation and there is no guarantee that the a timeout is triggered exactly after the timeout value. It is not recommended to use very low timeout values or checker intervals.- Parameters:
completionTimeoutExpression
- the timeout as anExpression
which is evaluated as aLong
type
-
getCompletionSizeExpression
-
setCompletionSizeExpression
Number of messages aggregated before the aggregation is complete. This option can be set as either a fixed value or using an Expression which allows you to evaluate a size dynamically - will use Integer as result. If both are set Camel will fallback to use the fixed value if the Expression result was null or 0.- Parameters:
completionSizeExpression
- the completion size as anExpression
which is evaluated as aInteger
type
-
getCompletionFromBatchConsumer
-
setCompletionFromBatchConsumer
-
getCompletionOnNewCorrelationGroup
-
setCompletionOnNewCorrelationGroup
-
getOptimisticLocking
-
setOptimisticLocking
-
getParallelProcessing
-
setParallelProcessing
-
getExecutorService
-
setExecutorService
-
getEagerCheckCompletion
-
setEagerCheckCompletion
-
getIgnoreInvalidCorrelationKeys
-
setIgnoreInvalidCorrelationKeys
-
getCloseCorrelationKeyOnCompletion
-
setCloseCorrelationKeyOnCompletion
-
getDiscardOnCompletionTimeout
-
setDiscardOnCompletionTimeout
-
getDiscardOnAggregationFailure
-
setDiscardOnAggregationFailure
-
getTimeoutCheckerExecutorService
-
setTimeoutCheckerExecutorService
-
getForceCompletionOnStop
-
setForceCompletionOnStop
-
getCompleteAllOnStop
-
setCompleteAllOnStop
-
getAggregateController
-
setAggregateController
To use aAggregateController
to allow external sources to control this aggregator. -
setAggregateController
public void setAggregateController(org.apache.camel.processor.aggregate.AggregateController aggregateController) -
eagerCheckCompletion
Use eager completion checking which means that the completionPredicate will use the incoming Exchange. As opposed to without eager completion checking the completionPredicate will use the aggregated Exchange.- Returns:
- builder
-
ignoreInvalidCorrelationKeys
If a correlation key cannot be successfully evaluated it will be ignored by logging a DEBUG and then just ignore the incoming Exchange.- Returns:
- builder
-
closeCorrelationKeyOnCompletion
Closes a correlation key when its complete. Any late received exchanges which has a correlation key that has been closed, it will be defined and a ClosedCorrelationKeyException is thrown.- Parameters:
capacity
- the maximum capacity of the closed correlation key cache. Use 0 or negative value for unbounded capacity.- Returns:
- builder
-
discardOnCompletionTimeout
Discards the aggregated message on completion timeout. This means on timeout the aggregated message is dropped and not sent out of the aggregator.- Returns:
- builder
-
discardOnAggregationFailure
Discards the aggregated message when aggregation failed (an exception was thrown fromAggregationStrategy
. This means the partly aggregated message is dropped and not sent out of the aggregator. This option cannot be used together with completionFromBatchConsumer.- Returns:
- builder
-
completionFromBatchConsumer
Enables the batch completion mode where we aggregate from aBatchConsumer
and aggregate the total number of exchanges theBatchConsumer
has reported as total by checking the exchange propertyExchange.BATCH_COMPLETE
when its complete. This option cannot be used together with discardOnAggregationFailure.- Returns:
- builder
-
completionOnNewCorrelationGroup
Enables completion on all previous groups when a new incoming correlation group. This can for example be used to complete groups with same correlation keys when they are in consecutive order. Notice when this is enabled then only 1 correlation group can be in progress as when a new correlation group starts, then the previous groups is forced completed.- Returns:
- builder
-
completionSize
Number of messages aggregated before the aggregation is complete. This option can be set as either a fixed value or using an Expression which allows you to evaluate a size dynamically - will use Integer as result. If both are set Camel will fallback to use the fixed value if the Expression result was null or 0.- Parameters:
completionSize
- the completion size, must be a an expression evaluating to positive number- Returns:
- builder
-
completionSize
Number of messages aggregated before the aggregation is complete. This option can be set as either a fixed value or using an Expression which allows you to evaluate a size dynamically - will use Integer as result. If both are set Camel will fallback to use the fixed value if the Expression result was null or 0.- Parameters:
completionSize
- the completion size, must be a positive number- Returns:
- builder
-
completionSize
Number of messages aggregated before the aggregation is complete. This option can be set as either a fixed value or using an Expression which allows you to evaluate a size dynamically - will use Integer as result. If both are set Camel will fallback to use the fixed value if the Expression result was null or 0.- Parameters:
completionSize
- the completion size as anExpression
which is evaluated as aInteger
type- Returns:
- builder
-
completionInterval
A repeating period in millis by which the aggregator will complete all current aggregated exchanges. Camel has a background task which is triggered every period. You cannot use this option together with completionTimeout, only one of them can be used.- Parameters:
completionInterval
- the interval in millis, must be a positive value- Returns:
- the builder
-
completionInterval
A repeating period in millis by which the aggregator will complete all current aggregated exchanges. Camel has a background task which is triggered every period. You cannot use this option together with completionTimeout, only one of them can be used.- Parameters:
completionInterval
- the interval in millis, must be a positive value- Returns:
- the builder
-
completionTimeout
Time in millis that an aggregated exchange should be inactive before its complete (timeout). This option can be set as either a fixed value or using an Expression which allows you to evaluate a timeout dynamically - will use Long as result. If both are set Camel will fallback to use the fixed value if the Expression result was null or 0. You cannot use this option together with completionInterval, only one of the two can be used. By default the timeout checker runs every second, you can use the completionTimeoutCheckerInterval option to configure how frequently to run the checker. The timeout is an approximation and there is no guarantee that the a timeout is triggered exactly after the timeout value. It is not recommended to use very low timeout values or checker intervals.- Parameters:
completionTimeout
- the timeout in millis, must be a positive value- Returns:
- the builder
-
completionTimeout
Time in millis that an aggregated exchange should be inactive before its complete (timeout). This option can be set as either a fixed value or using an Expression which allows you to evaluate a timeout dynamically - will use Long as result. If both are set Camel will fallback to use the fixed value if the Expression result was null or 0. You cannot use this option together with completionInterval, only one of the two can be used. By default the timeout checker runs every second, you can use the completionTimeoutCheckerInterval option to configure how frequently to run the checker. The timeout is an approximation and there is no guarantee that the a timeout is triggered exactly after the timeout value. It is not recommended to use very low timeout values or checker intervals.- Parameters:
completionTimeout
- the timeout in millis, must be a positive value- Returns:
- the builder
-
completionTimeout
Time in millis that an aggregated exchange should be inactive before its complete (timeout). This option can be set as either a fixed value or using an Expression which allows you to evaluate a timeout dynamically - will use Long as result. If both are set Camel will fallback to use the fixed value if the Expression result was null or 0. You cannot use this option together with completionInterval, only one of the two can be used. By default the timeout checker runs every second, you can use the completionTimeoutCheckerInterval option to configure how frequently to run the checker. The timeout is an approximation and there is no guarantee that the a timeout is triggered exactly after the timeout value. It is not recommended to use very low timeout values or checker intervals.- Parameters:
completionTimeout
- the timeout as anExpression
which is evaluated as aLong
type- Returns:
- the builder
-
completionTimeoutCheckerInterval
Interval in millis that is used by the background task that checks for timeouts (TimeoutMap
). By default the timeout checker runs every second. The timeout is an approximation and there is no guarantee that the a timeout is triggered exactly after the timeout value. It is not recommended to use very low timeout values or checker intervals.- Parameters:
completionTimeoutCheckerInterval
- the interval in millis, must be a positive value- Returns:
- the builder
-
aggregationStrategy
Sets the AggregationStrategy to use with a fluent builder. -
aggregationStrategy
public AggregateDefinition aggregationStrategy(org.apache.camel.AggregationStrategy aggregationStrategy) Sets the aggregate strategy to use- Specified by:
aggregationStrategy
in interfaceAggregationStrategyAwareDefinition<AggregateDefinition>
- Parameters:
aggregationStrategy
- the aggregate strategy to use- Returns:
- the builder
-
aggregationStrategy
Sets the aggregate strategy to use- Specified by:
aggregationStrategy
in interfaceAggregationStrategyAwareDefinition<AggregateDefinition>
- Parameters:
aggregationStrategy
- reference to the strategy to lookup in the registry- Returns:
- the builder
-
aggregationStrategyMethodName
Sets the method name to use when using a bean asAggregationStrategy
.- Parameters:
methodName
- the method name to call- Returns:
- the builder
-
aggregationStrategyMethodAllowNull
Sets allowing null when using a bean asAggregationStrategy
.- Returns:
- the builder
-
aggregationRepository
public AggregateDefinition aggregationRepository(org.apache.camel.spi.AggregationRepository aggregationRepository) Sets the custom aggregate repository to use. Will by default useMemoryAggregationRepository
- Parameters:
aggregationRepository
- the aggregate repository to use- Returns:
- the builder
-
aggregationRepository
Sets the custom aggregate repository to use. Will by default useMemoryAggregationRepository
- Parameters:
aggregationRepository
- reference to the repository to lookup in the registry- Returns:
- the builder
-
completionPredicate
A Predicate to indicate when an aggregated exchange is complete. If this is not specified and the AggregationStrategy object implements Predicate, the aggregationStrategy object will be used as the completionPredicate. -
completionPredicate
A Predicate to indicate when an aggregated exchange is complete. If this is not specified and the AggregationStrategy object implements Predicate, the aggregationStrategy object will be used as the completionPredicate. -
completion
A Predicate to indicate when an aggregated exchange is complete. If this is not specified and the AggregationStrategy object implements Predicate, the aggregationStrategy object will be used as the completionPredicate. -
completion
A Predicate to indicate when an aggregated exchange is complete. If this is not specified and the AggregationStrategy object implements Predicate, the aggregationStrategy object will be used as the completionPredicate. -
forceCompletionOnStop
Indicates to complete all current aggregated exchanges when the context is stopped -
completeAllOnStop
Indicates to wait to complete all current and partial (pending) aggregated exchanges when the context is stopped. This also means that we will wait for all pending exchanges which are stored in the aggregation repository to complete so the repository is empty before we can stop. You may want to enable this when using the memory based aggregation repository that is memory based only, and do not store data on disk. When this option is enabled, then the aggregator is waiting to complete all those exchanges before its stopped, when stopping CamelContext or the route using it. -
parallelProcessing
When aggregated are completed they are being send out of the aggregator. This option indicates whether or not Camel should use a thread pool with multiple threads for concurrency. If no custom thread pool has been specified then Camel creates a default pool with 10 concurrent threads. -
parallelProcessing
When aggregated are completed they are being send out of the aggregator. This option indicates whether or not Camel should use a thread pool with multiple threads for concurrency. If no custom thread pool has been specified then Camel creates a default pool with 10 concurrent threads. -
optimisticLocking
Turns on using optimistic locking, which requires the aggregationRepository being used, is supporting this by implementingOptimisticLockingAggregationRepository
. -
optimisticLockRetryPolicy
public AggregateDefinition optimisticLockRetryPolicy(org.apache.camel.processor.aggregate.OptimisticLockRetryPolicy policy) Allows to configure retry settings when using optimistic locking. -
executorService
If using parallelProcessing you can specify a custom thread pool to be used. In fact also if you are not using parallelProcessing this custom thread pool is used to send out aggregated exchanges as well.- Specified by:
executorService
in interfaceExecutorServiceAwareDefinition<AggregateDefinition>
- Parameters:
executorService
- the executor service- Returns:
- the builder
-
executorService
If using parallelProcessing you can specify a custom thread pool to be used. In fact also if you are not using parallelProcessing this custom thread pool is used to send out aggregated exchanges as well.- Specified by:
executorService
in interfaceExecutorServiceAwareDefinition<AggregateDefinition>
- Parameters:
executorService
- reference for aExecutorService
to lookup in theRegistry
- Returns:
- the builder
-
timeoutCheckerExecutorService
If using either of the completionTimeout, completionTimeoutExpression, or completionInterval options a background thread is created to check for the completion for every aggregator. Set this option to provide a custom thread pool to be used rather than creating a new thread for every aggregator. -
timeoutCheckerExecutorService
If using either of the completionTimeout, completionTimeoutExpression, or completionInterval options a background thread is created to check for the completion for every aggregator. Set this option to provide a custom thread pool to be used rather than creating a new thread for every aggregator. -
aggregateController
public AggregateDefinition aggregateController(org.apache.camel.processor.aggregate.AggregateController aggregateController) To use aAggregateController
to allow external sources to control this aggregator. -
aggregateController
To use aAggregateController
to allow external sources to control this aggregator. -
getExpression
-
setExpression
-
setExpression
public void setExpression(org.apache.camel.Expression expression) -
checkNoCompletedPredicate
protected void checkNoCompletedPredicate() -
getOutputs
- Overrides:
getOutputs
in classOutputDefinition<AggregateDefinition>
-
setOutputs
- Overrides:
setOutputs
in classOutputDefinition<AggregateDefinition>
-