org.mule.processor
Class IdempotentRedeliveryPolicy

java.lang.Object
  extended by org.mule.processor.AbstractInterceptingMessageProcessorBase
      extended by org.mule.processor.AbstractInterceptingMessageProcessor
          extended by org.mule.processor.AbstractRedeliveryPolicy
              extended by org.mule.processor.IdempotentRedeliveryPolicy
All Implemented Interfaces:
AnnotatedObject, FlowConstructAware, MuleContextAware, Disposable, Initialisable, Lifecycle, Startable, Stoppable, InterceptingMessageProcessor, MessageProcessor, MessageProcessorContainer, MessageSource

public class IdempotentRedeliveryPolicy
extends AbstractRedeliveryPolicy

Implement a retry policy for Mule. This is similar to JMS retry policies that will redeliver a message a maximum number of times. If this maximum is exceeded, the message is sent to a dead letter queue, Here, if the processing of the messages fails too often, the message is sent to the failedMessageProcessor MP, whence success is force to be returned, to allow the message to be considered "consumed".


Field Summary
protected  Logger logger
           
 
Fields inherited from class org.mule.processor.AbstractRedeliveryPolicy
deadLetterQueue, flowConstruct, maxRedeliveryCount, REDELIVERY_FAIL_ON_FIRST
 
Fields inherited from class org.mule.processor.AbstractInterceptingMessageProcessorBase
muleContext, next, notificationHandler
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Fields inherited from interface org.mule.api.AnnotatedObject
PROPERTY_NAME
 
Constructor Summary
IdempotentRedeliveryPolicy()
           
 
Method Summary
 void dispose()
          A lifecycle method where implementor should free up any resources.
 AtomicInteger findCounter(String messageId)
           
 String getIdExpression()
           
 String getMessageDigestAlgorithm()
           
 void initialise()
          Method used to perform any initialisation work.
 boolean isUseSecureHash()
           
 MuleEvent process(MuleEvent event)
          Invokes the MessageProcessor.
 void setIdExpression(String idExpression)
           
 void setMessageDigestAlgorithm(String messageDigestAlgorithm)
           
 void setMessageProcessor(MessageProcessor processor)
           
 void setUseSecureHash(boolean useSecureHash)
           
 void start()
           
 
Methods inherited from class org.mule.processor.AbstractRedeliveryPolicy
getMaxRedeliveryCount, getTheFailedMessageProcessor, setDeadLetterQueue, setFlowConstruct, setMaxRedeliveryCount, stop
 
Methods inherited from class org.mule.processor.AbstractInterceptingMessageProcessorBase
addMessageProcessorPathElements, getAnnotation, getAnnotations, getListener, getMuleContext, isEventValid, processNext, setAnnotations, setListener, setMuleContext, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.context.MuleContextAware
setMuleContext
 
Methods inherited from interface org.mule.api.source.MessageSource
setListener
 

Field Detail

logger

protected Logger logger
Constructor Detail

IdempotentRedeliveryPolicy

public IdempotentRedeliveryPolicy()
Method Detail

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
Overrides:
initialise in class AbstractRedeliveryPolicy
Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from

dispose

public void dispose()
Description copied from interface: Disposable
A lifecycle method where implementor should free up any resources. If an exception is thrown it should just be logged and processing should continue. This method should not throw Runtime exceptions.

Specified by:
dispose in interface Disposable
Overrides:
dispose in class AbstractRedeliveryPolicy

start

public void start()
           throws MuleException
Specified by:
start in interface Startable
Overrides:
start in class AbstractRedeliveryPolicy
Throws:
MuleException

process

public MuleEvent process(MuleEvent event)
                  throws MuleException
Description copied from interface: MessageProcessor
Invokes the MessageProcessor.

Parameters:
event - MuleEvent to be processed
Returns:
optional response MuleEvent
Throws:
MuleException

findCounter

public AtomicInteger findCounter(String messageId)
                          throws ObjectStoreException
Throws:
ObjectStoreException

isUseSecureHash

public boolean isUseSecureHash()

setUseSecureHash

public void setUseSecureHash(boolean useSecureHash)

getMessageDigestAlgorithm

public String getMessageDigestAlgorithm()

setMessageDigestAlgorithm

public void setMessageDigestAlgorithm(String messageDigestAlgorithm)

getIdExpression

public String getIdExpression()

setIdExpression

public void setIdExpression(String idExpression)

setMessageProcessor

public void setMessageProcessor(MessageProcessor processor)


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.