@ComponentProfile(summary="A Configurable Failed Message Retrier", tag="error-handling,base") public class DefaultFailedMessageRetrier extends FailedMessageRetrierImp
Implementation of FailedMessageRetrier
that does not allow duplicate workflows.
In the adapter configuration file this class is aliased as default-failed-message-retrier which is the preferred alternative to the fully qualified classname when building your configuration.
log
Constructor and Description |
---|
DefaultFailedMessageRetrier() |
Modifier and Type | Method and Description |
---|---|
void |
addWorkflow(Workflow workflow)
Add a
Workflow . |
void |
close()
Closes the component.
|
TimeInterval |
getShutdownWaitTime() |
void |
init()
Initialises the component.
|
void |
setShutdownWaitTime(TimeInterval interval)
Set the shutdown wait timeout for the pool.
|
void |
start()
Starts the component.
|
void |
stop()
Stop the component
|
clearWorkflows, friendlyName, getStandaloneConsumer, getUniqueId, getWorkflow, getWorkflows, onAdaptrisMessage, prepare, registeredWorkflowIds, setStandaloneConsumer, setUniqueId, updateRetryCountMetadata
public void addWorkflow(Workflow workflow) throws CoreException
FailedMessageRetrierImp
Workflow
.
Add a Workflow
to the internal store. If the generated key is not unique a CoreException
can be
thrown.
addWorkflow
in interface FailedMessageRetrier
addWorkflow
in class FailedMessageRetrierImp
workflow
- the workflow to addCoreException
- if it is considered a duplicatepublic void init() throws CoreException
ComponentLifecycle
Component initialisation includes config verification, creation of connections etc.
init
in interface ComponentLifecycle
init
in class FailedMessageRetrierImp
CoreException
- wrapping any underlying Exception
sComponentLifecycle.init()
public void start() throws CoreException
ComponentLifecycle
Once a component is started it should be ready to process messages. In the case of AdaptrisMessageConsumer
, calling start
will begin message delivery.
start
in interface ComponentLifecycle
start
in class FailedMessageRetrierImp
CoreException
- wrapping any underlying Exception
sComponentLifecycle.start()
public void stop()
ComponentLifecycle
A stopped component is not expected to be ready to process messages. In the case of AdaptrisMessageConsumer
, calling stop
will pause message delivery. Throwing a RuntimeException
may cause unintended consequences
stop
in interface ComponentLifecycle
stop
in class FailedMessageRetrierImp
ComponentLifecycle.stop()
public void close()
ComponentLifecycle
A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException
may
cause unintended consequences
close
in interface ComponentLifecycle
close
in class FailedMessageRetrierImp
ComponentLifecycle.close()
public TimeInterval getShutdownWaitTime()
public void setShutdownWaitTime(TimeInterval interval)
When close()
is invoked, this shutdowns the internal retry submission pool used by
DefaultFailedMessageRetrierJmxMBean
. The specified value is the amount of time to wait for a clean shutdown. If this
timeout is exceeded then a forced shutdown ensues, which may mean some messages will not have been retried.
interval
- the shutdown time (default is 60 seconds)stop()