@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, updateRetryCountMetadataclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonAdaptrisMessage, onAdaptrisMessagepublic void onAdaptrisMessage(AdaptrisMessage msg, java.util.function.Consumer<AdaptrisMessage> success, java.util.function.Consumer<AdaptrisMessage> failure)
AdaptrisMessageListeneronAdaptrisMessage in interface AdaptrisMessageListenermsg - the messagesuccess - called on successfailure - called on failurepublic void prepare()
throws CoreException
ComponentLifecycleExtensionprepare in interface ComponentLifecycleExtensionCoreExceptionpublic void init()
throws CoreException
ComponentLifecycleComponent initialisation includes config verification, creation of connections etc.
init in interface ComponentLifecycleCoreException - wrapping any underlying Exceptionspublic 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 ComponentLifecycleCoreException - wrapping any underlying ExceptionsComponentLifecycle.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 ComponentLifecyclepublic 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 ComponentLifecyclepublic void setStandaloneConsumer(StandaloneConsumer consumer)
public java.lang.String friendlyName()
AdaptrisMessageListenerfriendlyName in interface AdaptrisMessageListenerpublic 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.