org.mule.routing
Class IdempotentMessageFilter
java.lang.Object
org.mule.processor.AbstractInterceptingMessageProcessor
org.mule.processor.AbstractFilteringMessageProcessor
org.mule.routing.IdempotentMessageFilter
- All Implemented Interfaces:
- 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
assignedComponentName
protected volatile String assignedComponentName
flowConstruct
protected FlowConstruct flowConstruct
idExpression
protected String idExpression
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 AbstractInterceptingMessageProcessor
- Throws:
MuleException
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
Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.