Package org.apache.camel.model
Class ResequenceDefinition
java.lang.Object
org.apache.camel.model.OptionalIdentifiedDefinition<Type>
org.apache.camel.model.ProcessorDefinition<Type>
org.apache.camel.model.OutputDefinition<ResequenceDefinition>
org.apache.camel.model.ResequenceDefinition
- All Implemented Interfaces:
org.apache.camel.CamelContextAware
,org.apache.camel.LineNumberAware
,Block
,HasExpressionType
,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 ResequenceDefinition
extends OutputDefinition<ResequenceDefinition>
implements HasExpressionType
Resequences (re-order) messages based on an expression
-
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
-
Method Summary
Modifier and TypeMethodDescriptionEnables duplicates for the batch resequencer modebatch()
Configures the batch-based resequencing algorithm using the default configuration.batch
(BatchResequencerConfig config) Configures the batch-based resequencing algorithm using the givenBatchResequencerConfig
.capacity
(int capacity) Sets the capacity for the stream resequencercomparator
(org.apache.camel.processor.resequencer.ExpressionResultComparator comparator) Sets the comparator to use for stream resequencerdeliveryAttemptInterval
(long deliveryAttemptInterval) Sets the interval in milli seconds the stream resequencer will at most wait while waiting for condition of being able to deliver.Gets the expression definitiongetLabel()
Returns a label to describe this node such as the expression if some kind of expression nodeIf an incomingExchange
is invalid, then it will be ignored.Sets the rejectOld flag to throw an error when a message older than the last delivered message is processedreverse()
Enables reverse mode for the batch resequencer mode.void
setBatchConfig
(BatchResequencerConfig batchConfig) void
setExpression
(org.apache.camel.Expression expression) Expression to use for re-ordering the messages, such as a header with a sequence numbervoid
setExpression
(ExpressionDefinition expression) Expression to use for re-ordering the messages, such as a header with a sequence numbervoid
setExpressionType
(ExpressionDefinition expressionType) Expression to use for re-ordering the messages, such as a header with a sequence numbervoid
setOutputs
(List<ProcessorDefinition<?>> outputs) void
setResequencerConfig
(ResequencerConfig resequencerConfig) To configure the resequencer in using either batch or stream configuration.void
setStreamConfig
(StreamResequencerConfig streamConfig) size
(int batchSize) Sets the in batch size for number of exchanges receivedstream()
Configures the stream-based resequencing algorithm using the default configuration.stream
(StreamResequencerConfig config) Configures the stream-based resequencing algorithm using the givenStreamResequencerConfig
.timeout
(long timeout) Sets the timeoutSets the timeoutSets the timeouttoString()
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, configureChild, convertBodyTo, convertBodyTo, convertBodyTo, 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, 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, setInheritErrorHandler, setParent, setProperty, setProperty, setProperty, setRouteConfiguration, 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, toF, transacted, transacted, transform, transform, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, getCamelContext, getCustomId, getDescription, getDescriptionText, getId, getLineNumber, getLocation, hasCustomIdAssigned, idOrCreate, setCamelContext, setCustomId, setDescription, setGeneratedId, setId, setLineNumber, setLocation
-
Constructor Details
-
ResequenceDefinition
public ResequenceDefinition() -
ResequenceDefinition
public ResequenceDefinition(org.apache.camel.Expression expression)
-
-
Method Details
-
getOutputs
- Overrides:
getOutputs
in classOutputDefinition<ResequenceDefinition>
-
setOutputs
- Overrides:
setOutputs
in classOutputDefinition<ResequenceDefinition>
-
stream
Configures the stream-based resequencing algorithm using the default configuration.- Returns:
- the builder
-
batch
Configures the batch-based resequencing algorithm using the default configuration.- Returns:
- the builder
-
stream
Configures the stream-based resequencing algorithm using the givenStreamResequencerConfig
.- Parameters:
config
- the config- Returns:
- the builder
-
batch
Configures the batch-based resequencing algorithm using the givenBatchResequencerConfig
.- Parameters:
config
- the config- Returns:
- the builder
-
timeout
Sets the timeout- Parameters:
timeout
- timeout in millis- Returns:
- the builder
-
timeout
Sets the timeout- Parameters:
timeout
- timeout- Returns:
- the builder
-
timeout
Sets the timeout- Parameters:
timeout
- timeout- Returns:
- the builder
-
deliveryAttemptInterval
Sets the interval in milli seconds the stream resequencer will at most wait while waiting for condition of being able to deliver.- Parameters:
deliveryAttemptInterval
- interval in millis- Returns:
- the builder
-
rejectOld
Sets the rejectOld flag to throw an error when a message older than the last delivered message is processed- Returns:
- the builder
-
size
Sets the in batch size for number of exchanges received- Parameters:
batchSize
- the batch size- Returns:
- the builder
-
capacity
Sets the capacity for the stream resequencer- Parameters:
capacity
- the capacity- Returns:
- the builder
-
allowDuplicates
Enables duplicates for the batch resequencer mode- Returns:
- the builder
-
reverse
Enables reverse mode for the batch resequencer mode. This means the expression for determine the sequence order will be reversed. Can be used for Z..A or 9..0 ordering.- Returns:
- the builder
-
ignoreInvalidExchanges
If an incomingExchange
is invalid, then it will be ignored.- Returns:
- builder
-
comparator
public ResequenceDefinition comparator(org.apache.camel.processor.resequencer.ExpressionResultComparator comparator) Sets the comparator to use for stream resequencer- Parameters:
comparator
- the comparator- Returns:
- the builder
-
toString
- Overrides:
toString
in classOutputDefinition<ResequenceDefinition>
-
getShortName
- Specified by:
getShortName
in interfaceorg.apache.camel.NamedNode
- Overrides:
getShortName
in classOutputDefinition<ResequenceDefinition>
-
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<ResequenceDefinition>
-
getResequencerConfig
-
setResequencerConfig
To configure the resequencer in using either batch or stream configuration. Will by default use batch configuration. -
getBatchConfig
-
getStreamConfig
-
setBatchConfig
-
setStreamConfig
-
getExpression
-
setExpression
Expression to use for re-ordering the messages, such as a header with a sequence number -
setExpression
public void setExpression(org.apache.camel.Expression expression) Expression to use for re-ordering the messages, such as a header with a sequence number -
getExpressionType
Description copied from interface:HasExpressionType
Gets the expression definition- Specified by:
getExpressionType
in interfaceHasExpressionType
-
setExpressionType
Expression to use for re-ordering the messages, such as a header with a sequence number- Specified by:
setExpressionType
in interfaceHasExpressionType
-