public class IdempotentReceiver extends SelectiveConsumer
IdempotentReceiver
ensures that only unique messages are received by a
service. 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.IdempotentInMemoryMessageIdStore
.Modifier and Type | Field and Description |
---|---|
protected String |
assignedComponentName |
protected String |
idExpression |
protected ObjectStore |
store |
logger
muleContext
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
IdempotentReceiver() |
Modifier and Type | Method and Description |
---|---|
protected ObjectStore |
createMessageIdStore() |
String |
getIdExpression() |
protected String |
getIdForEvent(MuleEvent event) |
ObjectStore |
getStore() |
protected void |
initialize(MuleEvent event) |
boolean |
isMatch(MuleEvent event)
Determines if the event should be processed by this router.
|
MuleEvent[] |
process(MuleEvent event)
A received MuleEvent is passed to this method for processing.
|
void |
setIdExpression(String idExpression) |
void |
setStore(ObjectStore store) |
getFilter, getMessageInfoMapping, isTransformFirst, setFilter, setMessageInfoMapping, setTransformFirst
dispose, getMuleContext, getRouterStatistics, initialise, setMuleContext, setRouterStatistics
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRouterStatistics, setRouterStatistics
initialise
dispose
protected volatile ObjectStore store
protected volatile String assignedComponentName
protected String idExpression
protected void initialize(MuleEvent event) throws RoutingException
RoutingException
protected ObjectStore createMessageIdStore() throws InitialisationException
InitialisationException
public boolean isMatch(MuleEvent event) throws MessagingException
InboundRouter
isMatch
in interface InboundRouter
isMatch
in class SelectiveConsumer
event
- the current event to evaluateMessagingException
- if the event cannot be evaluatedSelectiveConsumer
public MuleEvent[] process(MuleEvent event) throws MessagingException
InboundRouter
process
in interface InboundRouter
process
in class SelectiveConsumer
event
- the event received by the inbound endpoint before it is passed to
the serviceMessagingException
- if an error occurs during processing of the eventprotected String getIdForEvent(MuleEvent event) throws MessagingException
MessagingException
public String getIdExpression()
public void setIdExpression(String idExpression)
public ObjectStore getStore()
public void setStore(ObjectStore store)
Copyright © 2003–2013 MuleSource, Inc.. All rights reserved.