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.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
inheritErrorHandler
-
-
Constructor Summary
Constructors Constructor Description ResequenceDefinition()ResequenceDefinition(org.apache.camel.Expression expression)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResequenceDefinitionallowDuplicates()Enables duplicates for the batch resequencer modeResequenceDefinitionbatch()Configures the batch-based resequencing algorithm using the default configuration.ResequenceDefinitionbatch(BatchResequencerConfig config)Configures the batch-based resequencing algorithm using the givenBatchResequencerConfig.ResequenceDefinitioncapacity(int capacity)Sets the capacity for the stream resequencerResequenceDefinitioncomparator(org.apache.camel.processor.resequencer.ExpressionResultComparator comparator)Sets the comparator to use for stream resequencerResequenceDefinitiondeliveryAttemptInterval(long deliveryAttemptInterval)Sets the interval in milli seconds the stream resequencer will at most wait while waiting for condition of being able to deliver.BatchResequencerConfiggetBatchConfig()ExpressionDefinitiongetExpression()ExpressionDefinitiongetExpressionType()Gets the expression definitionStringgetLabel()Returns a label to describe this node such as the expression if some kind of expression nodeList<ProcessorDefinition<?>>getOutputs()ResequencerConfiggetResequencerConfig()StringgetShortName()StreamResequencerConfiggetStreamConfig()ResequenceDefinitionignoreInvalidExchanges()If an incomingExchangeis invalid, then it will be ignored.ResequenceDefinitionrejectOld()Sets the rejectOld flag to throw an error when a message older than the last delivered message is processedResequenceDefinitionreverse()Enables reverse mode for the batch resequencer mode.voidsetBatchConfig(BatchResequencerConfig batchConfig)voidsetExpression(org.apache.camel.Expression expression)Expression to use for re-ordering the messages, such as a header with a sequence numbervoidsetExpression(ExpressionDefinition expression)Expression to use for re-ordering the messages, such as a header with a sequence numbervoidsetExpressionType(ExpressionDefinition expressionType)Expression to use for re-ordering the messages, such as a header with a sequence numbervoidsetOutputs(List<ProcessorDefinition<?>> outputs)voidsetResequencerConfig(ResequencerConfig resequencerConfig)To configure the resequencer in using either batch or stream configuration.voidsetStreamConfig(StreamResequencerConfig streamConfig)ResequenceDefinitionsize(int batchSize)Sets the in batch size for number of exchanges receivedResequenceDefinitionstream()Configures the stream-based resequencing algorithm using the default configuration.ResequenceDefinitionstream(StreamResequencerConfig config)Configures the stream-based resequencing algorithm using the givenStreamResequencerConfig.ResequenceDefinitiontimeout(long timeout)Sets the timeoutResequenceDefinitiontimeout(String timeout)Sets the timeoutResequenceDefinitiontimeout(Duration timeout)Sets the timeoutStringtoString()-
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, 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, getIndex, getInterceptStrategies, getParent, getRouteConfiguration, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, 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, onCompletion, onException, onException, pausable, pausable, pausable, pausable, pipeline, 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, sample, script, script, serviceCall, serviceCall, serviceCall, setBody, setBody, setBody, 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, to, to, toD, toD, toD, toD, toD, toD, toD, toF, transacted, transacted, 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, description, getCamelContext, getCustomId, getDescription, getDescriptionText, getId, getLineNumber, getLocation, hasCustomIdAssigned, idOrCreate, setCamelContext, setCustomId, setDescription, setGeneratedId, setId, setLineNumber, setLocation
-
-
-
-
Method Detail
-
getOutputs
public List<ProcessorDefinition<?>> getOutputs()
- Overrides:
getOutputsin classOutputDefinition<ResequenceDefinition>
-
setOutputs
public void setOutputs(List<ProcessorDefinition<?>> outputs)
- Overrides:
setOutputsin classOutputDefinition<ResequenceDefinition>
-
stream
public ResequenceDefinition stream()
Configures the stream-based resequencing algorithm using the default configuration.- Returns:
- the builder
-
batch
public ResequenceDefinition batch()
Configures the batch-based resequencing algorithm using the default configuration.- Returns:
- the builder
-
stream
public ResequenceDefinition stream(StreamResequencerConfig config)
Configures the stream-based resequencing algorithm using the givenStreamResequencerConfig.- Parameters:
config- the config- Returns:
- the builder
-
batch
public ResequenceDefinition batch(BatchResequencerConfig config)
Configures the batch-based resequencing algorithm using the givenBatchResequencerConfig.- Parameters:
config- the config- Returns:
- the builder
-
timeout
public ResequenceDefinition timeout(long timeout)
Sets the timeout- Parameters:
timeout- timeout in millis- Returns:
- the builder
-
timeout
public ResequenceDefinition timeout(Duration timeout)
Sets the timeout- Parameters:
timeout- timeout- Returns:
- the builder
-
timeout
public ResequenceDefinition timeout(String timeout)
Sets the timeout- Parameters:
timeout- timeout- Returns:
- the builder
-
deliveryAttemptInterval
public ResequenceDefinition deliveryAttemptInterval(long 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
public ResequenceDefinition rejectOld()
Sets the rejectOld flag to throw an error when a message older than the last delivered message is processed- Returns:
- the builder
-
size
public ResequenceDefinition size(int batchSize)
Sets the in batch size for number of exchanges received- Parameters:
batchSize- the batch size- Returns:
- the builder
-
capacity
public ResequenceDefinition capacity(int capacity)
Sets the capacity for the stream resequencer- Parameters:
capacity- the capacity- Returns:
- the builder
-
allowDuplicates
public ResequenceDefinition allowDuplicates()
Enables duplicates for the batch resequencer mode- Returns:
- the builder
-
reverse
public ResequenceDefinition 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
public ResequenceDefinition ignoreInvalidExchanges()
If an incomingExchangeis 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
public String toString()
- Overrides:
toStringin classOutputDefinition<ResequenceDefinition>
-
getShortName
public String getShortName()
- Specified by:
getShortNamein interfaceorg.apache.camel.NamedNode- Overrides:
getShortNamein classOutputDefinition<ResequenceDefinition>
-
getLabel
public String getLabel()
Description copied from class:ProcessorDefinitionReturns a label to describe this node such as the expression if some kind of expression node- Specified by:
getLabelin interfaceorg.apache.camel.NamedNode- Overrides:
getLabelin classProcessorDefinition<ResequenceDefinition>
-
getResequencerConfig
public ResequencerConfig getResequencerConfig()
-
setResequencerConfig
public void setResequencerConfig(ResequencerConfig resequencerConfig)
To configure the resequencer in using either batch or stream configuration. Will by default use batch configuration.
-
getBatchConfig
public BatchResequencerConfig getBatchConfig()
-
getStreamConfig
public StreamResequencerConfig getStreamConfig()
-
setBatchConfig
public void setBatchConfig(BatchResequencerConfig batchConfig)
-
setStreamConfig
public void setStreamConfig(StreamResequencerConfig streamConfig)
-
getExpression
public ExpressionDefinition getExpression()
-
setExpression
public void setExpression(ExpressionDefinition expression)
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
public ExpressionDefinition getExpressionType()
Description copied from interface:HasExpressionTypeGets the expression definition- Specified by:
getExpressionTypein interfaceHasExpressionType
-
setExpressionType
public void setExpressionType(ExpressionDefinition expressionType)
Expression to use for re-ordering the messages, such as a header with a sequence number- Specified by:
setExpressionTypein interfaceHasExpressionType
-
-