org.mule.routing
Class IdempotentMessageFilter
java.lang.Object
org.mule.processor.AbstractInterceptingMessageProcessorBase
org.mule.processor.AbstractInterceptingMessageProcessor
org.mule.processor.AbstractFilteringMessageProcessor
org.mule.routing.IdempotentMessageFilter
- All Implemented Interfaces:
- AnnotatedObject, FlowConstructAware, MuleContextAware, Initialisable, InterceptingMessageProcessor, MessageProcessor, MessageSource
- Direct Known Subclasses:
- IdempotentSecureHashMessageFilter
public class IdempotentMessageFilter
- extends AbstractFilteringMessageProcessor
- implements FlowConstructAware, Initialisable
IdempotentMessageFilter
ensures that only unique messages are passed
on. It does this by checking the unique ID of the incoming message. Note that the
underlying endpoint must support unique message IDs for this to work, otherwise a
UniqueIdNotSupportedException
is thrown.
EIP Reference:
http://www.eaipatterns.com/IdempotentReceiver.html
store
protected volatile ObjectStore<String> store
flowConstruct
protected FlowConstruct flowConstruct
storePrefix
protected String storePrefix
idExpression
protected String idExpression
valueExpression
protected String valueExpression
IdempotentMessageFilter
public IdempotentMessageFilter()
initialise
public void initialise()
throws InitialisationException
- Description copied from interface:
Initialisable
- Method used to perform any initialisation work. If a fatal error occurs during
initialisation an
InitialisationException
should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException
should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.
- Specified by:
initialise
in interface Initialisable
- Throws:
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdown
RecoverableException
- if an error occurs that can be recovered from
createMessageIdStore
protected ObjectStore<String> createMessageIdStore()
throws InitialisationException
- Throws:
InitialisationException
processNext
protected MuleEvent processNext(MuleEvent event)
throws MuleException
- Overrides:
processNext
in class AbstractInterceptingMessageProcessorBase
- Throws:
MuleException
getValueForEvent
protected String getValueForEvent(MuleEvent event)
throws MessagingException
- Throws:
MessagingException
getIdForEvent
protected String getIdForEvent(MuleEvent event)
throws MessagingException
- Throws:
MessagingException
getIdExpression
public String getIdExpression()
setIdExpression
public void setIdExpression(String idExpression)
getStore
public ObjectStore<String> getStore()
setStore
public void setStore(ObjectStore<String> store)
accept
protected boolean accept(MuleEvent event)
- Specified by:
accept
in class AbstractFilteringMessageProcessor
acceptMessageForFlowConstruct
protected boolean acceptMessageForFlowConstruct(MuleEvent event)
isNewMessage
protected boolean isNewMessage(MuleEvent event)
setFlowConstruct
public void setFlowConstruct(FlowConstruct flowConstruct)
- Specified by:
setFlowConstruct
in interface FlowConstructAware
getValueExpression
public String getValueExpression()
setValueExpression
public void setValueExpression(String valueExpression)
setStorePrefix
public void setStorePrefix(String storePrefix)
Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.