public class IdempotentMessageFilter extends AbstractFilteringMessageProcessor implements FlowConstructAware, Initialisable, Disposable
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
| Modifier and Type | Field and Description |
|---|---|
protected FlowConstruct |
flowConstruct |
protected String |
idExpression |
protected ObjectStore<String> |
store |
protected String |
storePrefix |
protected String |
valueExpression |
onUnacceptedFlowConstruct, throwOnUnaccepted, unacceptedMessageProcessorlogger, muleContext, next, notificationHandlerPHASE_NAMEPHASE_NAMEPROPERTY_NAME| Constructor and Description |
|---|
IdempotentMessageFilter() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
accept(MuleEvent event) |
protected boolean |
acceptMessageForFlowConstruct(MuleEvent event) |
protected ObjectStore<String> |
createMessageIdStore() |
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
String |
getIdExpression() |
protected String |
getIdForEvent(MuleEvent event) |
ObjectStore<String> |
getStore() |
String |
getValueExpression() |
protected String |
getValueForEvent(MuleEvent event) |
void |
initialise()
Method used to perform any initialisation work.
|
protected boolean |
isNewMessage(MuleEvent event) |
protected MuleEvent |
processNext(MuleEvent event) |
void |
setFlowConstruct(FlowConstruct flowConstruct) |
void |
setIdExpression(String idExpression) |
void |
setStore(ObjectStore<String> store) |
void |
setStorePrefix(String storePrefix) |
void |
setValueExpression(String valueExpression) |
filterUnacceptedException, getUnacceptedMessageProcessor, handleUnaccepted, isThrowOnUnaccepted, process, setThrowOnUnaccepted, setUnacceptedMessageProcessoraddMessageProcessorPathElements, getListener, getMuleContext, isEventValid, setListener, setMuleContext, toStringgetAnnotation, getAnnotations, setAnnotationsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetListenerprotected volatile ObjectStore<String> store
protected FlowConstruct flowConstruct
protected String storePrefix
protected String idExpression
protected String valueExpression
public void initialise()
throws InitialisationException
InitialisableInitialisationException 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.initialise in interface InitialisableInitialisationException - if a fatal error occurs causing the Mule instance to shutdownRecoverableException - if an error occurs that can be recovered frompublic void dispose()
Disposabledispose in interface Disposableprotected ObjectStore<String> createMessageIdStore() throws InitialisationException
InitialisationExceptionprotected MuleEvent processNext(MuleEvent event) throws MuleException
processNext in class AbstractInterceptingMessageProcessorBaseMuleExceptionprotected String getValueForEvent(MuleEvent event) throws MessagingException
MessagingExceptionprotected String getIdForEvent(MuleEvent event) throws MessagingException
MessagingExceptionpublic String getIdExpression()
public void setIdExpression(String idExpression)
public ObjectStore<String> getStore()
public void setStore(ObjectStore<String> store)
protected boolean accept(MuleEvent event)
accept in class AbstractFilteringMessageProcessorprotected boolean acceptMessageForFlowConstruct(MuleEvent event)
protected boolean isNewMessage(MuleEvent event)
public void setFlowConstruct(FlowConstruct flowConstruct)
setFlowConstruct in interface FlowConstructAwarepublic String getValueExpression()
public void setValueExpression(String valueExpression)
public void setStorePrefix(String storePrefix)
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.