@ComponentProfile(summary="A Configurable Failed Message Retrier", tag="error-handling,base") public class DefaultFailedMessageRetrier extends FailedMessageRetrierImp implements AdaptrisMessageListener
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 |
close()
Closes the component.
|
java.lang.String |
friendlyName()
Get the friendly name for this component.
|
TimeInterval |
getShutdownWaitTime()
Set the shutdown wait timeout for the pool.
|
StandaloneConsumer |
getStandaloneConsumer() |
void |
init()
Initialises the component.
|
void |
onAdaptrisMessage(AdaptrisMessage msg,
java.util.function.Consumer<AdaptrisMessage> success,
java.util.function.Consumer<AdaptrisMessage> failure)
Handle a message with call back actions if a message is successful or failed.
|
void |
prepare()
Prepare for initialisation.
|
void |
setShutdownWaitTime(TimeInterval shutdownWaitTime)
Set the shutdown wait timeout for the pool.
|
void |
setStandaloneConsumer(StandaloneConsumer consumer) |
void |
start()
Starts the component.
|
void |
stop()
Stop the component
|
addWorkflow, clearWorkflows, getUniqueId, getWorkflow, getWorkflow, getWorkflows, registeredWorkflowIds, setUniqueId, updateRetryCountMetadata
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onAdaptrisMessage, onAdaptrisMessage
public void onAdaptrisMessage(AdaptrisMessage msg, java.util.function.Consumer<AdaptrisMessage> success, java.util.function.Consumer<AdaptrisMessage> failure)
AdaptrisMessageListener
onAdaptrisMessage
in interface AdaptrisMessageListener
msg
- the messagesuccess
- called on successfailure
- called on failurepublic void prepare() throws CoreException
ComponentLifecycleExtension
prepare
in interface ComponentLifecycleExtension
CoreException
public void init() throws CoreException
ComponentLifecycle
Component initialisation includes config verification, creation of connections etc.
init
in interface ComponentLifecycle
CoreException
- wrapping any underlying Exception
spublic 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
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
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
public void setStandaloneConsumer(StandaloneConsumer consumer)
public java.lang.String friendlyName()
AdaptrisMessageListener
friendlyName
in interface AdaptrisMessageListener
public StandaloneConsumer getStandaloneConsumer()
public TimeInterval getShutdownWaitTime()
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. The default is 60 seconds if not explicitly
specified.
public void setShutdownWaitTime(TimeInterval shutdownWaitTime)
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. The default is 60 seconds if not explicitly
specified.