org.mule.processor
Class AbstractRedeliveryPolicy
java.lang.Object
org.mule.processor.AbstractInterceptingMessageProcessorBase
org.mule.processor.AbstractInterceptingMessageProcessor
org.mule.processor.AbstractRedeliveryPolicy
- All Implemented Interfaces:
- AnnotatedObject, FlowConstructAware, MuleContextAware, Disposable, Initialisable, Lifecycle, Startable, Stoppable, InterceptingMessageProcessor, MessageProcessor, MessageSource
- Direct Known Subclasses:
- IdempotentRedeliveryPolicy
public abstract class AbstractRedeliveryPolicy
- extends AbstractInterceptingMessageProcessor
- implements MessageProcessor, Lifecycle, MuleContextAware, FlowConstructAware
Implement a redelivery 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".
flowConstruct
protected FlowConstruct flowConstruct
maxRedeliveryCount
protected int maxRedeliveryCount
deadLetterQueue
protected MessageProcessor deadLetterQueue
REDELIVERY_FAIL_ON_FIRST
public static final int REDELIVERY_FAIL_ON_FIRST
- See Also:
- Constant Field Values
AbstractRedeliveryPolicy
public AbstractRedeliveryPolicy()
setFlowConstruct
public void setFlowConstruct(FlowConstruct flowConstruct)
- Specified by:
setFlowConstruct
in interface FlowConstructAware
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
start
public void start()
throws MuleException
- Specified by:
start
in interface Startable
- Throws:
MuleException
stop
public void stop()
throws MuleException
- Specified by:
stop
in interface Stoppable
- Throws:
MuleException
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
getMaxRedeliveryCount
public int getMaxRedeliveryCount()
setMaxRedeliveryCount
public void setMaxRedeliveryCount(int maxRedeliveryCount)
getTheFailedMessageProcessor
public MessageProcessor getTheFailedMessageProcessor()
setDeadLetterQueue
public void setDeadLetterQueue(MessageProcessorFilterPair failedMessageProcessorPair)
Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.