Package org.apache.camel.model
Class IdempotentConsumerDefinition
java.lang.Object
org.apache.camel.model.OptionalIdentifiedDefinition<ExpressionNode>
org.apache.camel.model.ProcessorDefinition<ExpressionNode>
org.apache.camel.model.ExpressionNode
org.apache.camel.model.OutputExpressionNode
org.apache.camel.model.IdempotentConsumerDefinition
- 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 IdempotentConsumerDefinition
extends OutputExpressionNode
Filters out duplicate messages
-
Field Summary
Fields inherited from class org.apache.camel.model.ProcessorDefinition
disabled, inheritErrorHandler
-
Constructor Summary
ConstructorDescriptionIdempotentConsumerDefinition
(org.apache.camel.Expression messageIdExpression, org.apache.camel.spi.IdempotentRepository idempotentRepository) -
Method Summary
Modifier and TypeMethodDescriptioncompletionEager
(boolean completionEager) Sets whether to complete the idempotent consumer eager or when the exchange is done.eager
(boolean eager) Sets whether to eagerly add the key to the idempotent repository or wait until the exchange is complete.getEager()
org.apache.camel.spi.IdempotentRepository
getLabel()
Returns a label to describe this node such as the expression if some kind of expression nodeSets the reference name of the message id repositoryidempotentRepository
(org.apache.camel.spi.IdempotentRepository idempotentRepository) Sets the message id repository for the idempotent consumerremoveOnFailure
(boolean removeOnFailure) Sets whether to remove or keep the key on failure.void
setCompletionEager
(String completionEager) void
void
setExpression
(ExpressionDefinition expression) Expression used to calculate the correlation key to use for duplicate check.void
setIdempotentRepository
(String idempotentRepository) void
setIdempotentRepository
(org.apache.camel.spi.IdempotentRepository idempotentRepository) void
setRemoveOnFailure
(String removeOnFailure) void
setSkipDuplicate
(String skipDuplicate) skipDuplicate
(boolean skipDuplicate) Sets whether to skip duplicates or not.toString()
Methods inherited from class org.apache.camel.model.OutputExpressionNode
getOutputs, setOutputs
Methods inherited from class org.apache.camel.model.ExpressionNode
configureChild, getExpression, getExpressionType, id, preCreateProcessor, setExpression, setExpressionType
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, 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, 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
-
IdempotentConsumerDefinition
public IdempotentConsumerDefinition() -
IdempotentConsumerDefinition
public IdempotentConsumerDefinition(org.apache.camel.Expression messageIdExpression, org.apache.camel.spi.IdempotentRepository idempotentRepository)
-
-
Method Details
-
toString
-
getShortName
-
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 classExpressionNode
-
idempotentRepository
Sets the reference name of the message id repository- Parameters:
ref
- the reference name of message id repository- Returns:
- builder
-
idempotentRepository
public IdempotentConsumerDefinition idempotentRepository(org.apache.camel.spi.IdempotentRepository idempotentRepository) Sets the message id repository for the idempotent consumer- Parameters:
idempotentRepository
- the repository instance of idempotent- Returns:
- builder
-
eager
Sets whether to eagerly add the key to the idempotent repository or wait until the exchange is complete. Eager is default enabled.- Parameters:
eager
- true to add the key before processing, false to wait until the exchange is complete.- Returns:
- builder
-
completionEager
Sets whether to complete the idempotent consumer eager or when the exchange is done. If this option is true to complete eager, then the idempotent consumer will trigger its completion when the exchange reached the end of the block of the idempotent consumer pattern. So if the exchange is continued routed after the block ends, then whatever happens there does not affect the state. If this option is false (default) to not complete eager, then the idempotent consumer will complete when the exchange is done being routed. So if the exchange is continued routed after the block ends, then whatever happens there also affect the state. For example if the exchange failed due to an exception, then the state of the idempotent consumer will be a rollback.- Parameters:
completionEager
- whether to complete eager or complete when the exchange is done- Returns:
- builder
-
removeOnFailure
Sets whether to remove or keep the key on failure. The default behavior is to remove the key on failure.- Parameters:
removeOnFailure
- true to remove the key, false to keep the key if the exchange fails.- Returns:
- builder
-
skipDuplicate
Sets whether to skip duplicates or not. The default behavior is to skip duplicates. A duplicate message would have the Exchange propertyExchange.DUPLICATE_MESSAGE
set to aBoolean.TRUE
value. A none duplicate message will not have this property set.- Parameters:
skipDuplicate
- true to skip duplicates, false to allow duplicates.- Returns:
- builder
-
setExpression
Expression used to calculate the correlation key to use for duplicate check. The Exchange which has the same correlation key is regarded as a duplicate and will be rejected.- Overrides:
setExpression
in classExpressionNode
-
getIdempotentRepositoryBean
public org.apache.camel.spi.IdempotentRepository getIdempotentRepositoryBean() -
getIdempotentRepository
-
setIdempotentRepository
-
setIdempotentRepository
public void setIdempotentRepository(org.apache.camel.spi.IdempotentRepository idempotentRepository) -
getEager
-
setEager
-
getSkipDuplicate
-
setSkipDuplicate
-
getRemoveOnFailure
-
setRemoveOnFailure
-
getCompletionEager
-
setCompletionEager
-