Package org.apache.camel.model
Class IdempotentConsumerDefinition
- java.lang.Object
-
- org.apache.camel.model.OptionalIdentifiedDefinition<Type>
-
- 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.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
inheritErrorHandler
-
-
Constructor Summary
Constructors Constructor Description IdempotentConsumerDefinition()IdempotentConsumerDefinition(org.apache.camel.Expression messageIdExpression, org.apache.camel.spi.IdempotentRepository idempotentRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IdempotentConsumerDefinitioncompletionEager(boolean completionEager)Sets whether to complete the idempotent consumer eager or when the exchange is done.IdempotentConsumerDefinitioneager(boolean eager)Sets whether to eagerly add the key to the idempotent repository or wait until the exchange is complete.StringgetCompletionEager()StringgetEager()StringgetIdempotentRepository()org.apache.camel.spi.IdempotentRepositorygetIdempotentRepositoryBean()StringgetLabel()Returns a label to describe this node such as the expression if some kind of expression nodeStringgetRemoveOnFailure()StringgetShortName()StringgetSkipDuplicate()IdempotentConsumerDefinitionidempotentRepository(String ref)Sets the reference name of the message id repositoryIdempotentConsumerDefinitionidempotentRepository(org.apache.camel.spi.IdempotentRepository idempotentRepository)Sets the message id repository for the idempotent consumerIdempotentConsumerDefinitionremoveOnFailure(boolean removeOnFailure)Sets whether to remove or keep the key on failure.voidsetCompletionEager(String completionEager)voidsetEager(String eager)voidsetExpression(ExpressionDefinition expression)Expression used to calculate the correlation key to use for duplicate check.voidsetIdempotentRepository(String idempotentRepository)voidsetIdempotentRepository(org.apache.camel.spi.IdempotentRepository idempotentRepository)voidsetRemoveOnFailure(String removeOnFailure)voidsetSkipDuplicate(String skipDuplicate)IdempotentConsumerDefinitionskipDuplicate(boolean skipDuplicate)Sets whether to skip duplicates or not.StringtoString()-
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, 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, 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, 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
-
getShortName
public String getShortName()
-
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 classExpressionNode
-
idempotentRepository
public IdempotentConsumerDefinition idempotentRepository(String ref)
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
public IdempotentConsumerDefinition eager(boolean 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
public IdempotentConsumerDefinition completionEager(boolean 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
public IdempotentConsumerDefinition removeOnFailure(boolean 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
public IdempotentConsumerDefinition skipDuplicate(boolean skipDuplicate)
Sets whether to skip duplicates or not. The default behavior is to skip duplicates. A duplicate message would have the Exchange propertyExchange.DUPLICATE_MESSAGEset to aBoolean.TRUEvalue. A none duplicate message will not have this property set.- Parameters:
skipDuplicate- true to skip duplicates, false to allow duplicates.- Returns:
- builder
-
setExpression
public void setExpression(ExpressionDefinition expression)
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:
setExpressionin classExpressionNode
-
getIdempotentRepositoryBean
public org.apache.camel.spi.IdempotentRepository getIdempotentRepositoryBean()
-
getIdempotentRepository
public String getIdempotentRepository()
-
setIdempotentRepository
public void setIdempotentRepository(String idempotentRepository)
-
setIdempotentRepository
public void setIdempotentRepository(org.apache.camel.spi.IdempotentRepository idempotentRepository)
-
getEager
public String getEager()
-
setEager
public void setEager(String eager)
-
getSkipDuplicate
public String getSkipDuplicate()
-
setSkipDuplicate
public void setSkipDuplicate(String skipDuplicate)
-
getRemoveOnFailure
public String getRemoveOnFailure()
-
setRemoveOnFailure
public void setRemoveOnFailure(String removeOnFailure)
-
getCompletionEager
public String getCompletionEager()
-
setCompletionEager
public void setCompletionEager(String completionEager)
-
-