public abstract class RetryMessageErrorHandlerImp extends StandardProcessingExceptionHandler
| Modifier and Type | Class and Description |
|---|---|
protected class |
RetryMessageErrorHandlerImp.RetryThread
Private thread used to resubmit messages.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.ScheduledExecutorService |
executor |
protected java.util.List<AdaptrisMessage> |
inProgress |
protected static java.lang.String |
IS_RETRY_KEY |
protected static java.lang.String |
RETRY_COUNT_KEY |
protected java.util.List<AdaptrisMessage> |
retryList |
log| Constructor and Description |
|---|
RetryMessageErrorHandlerImp() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
failAllMessages() |
protected void |
failFutureMessages(boolean failFuture) |
protected void |
failMessage(AdaptrisMessage msg) |
protected void |
failMessage(java.lang.String s) |
protected static java.util.Map<java.lang.String,Workflow> |
filterStarted(java.util.Map<java.lang.String,Workflow> workflows) |
TimeInterval |
getRetryInterval() |
java.lang.Integer |
getRetryLimit()
Get the retry limit.
|
void |
handleProcessingException(AdaptrisMessage msg)
Handles error messages from Workflows by sending them to the configured
error producer.
|
protected void |
scheduleNextRun(AdaptrisMessage msg) |
void |
setRetryInterval(TimeInterval interval)
Set the interval between attempts to retry a failed message.
|
void |
setRetryLimit(java.lang.Integer i)
Set the limit on the number of retries that a message may have.
|
void |
start()
Starts the component.
|
void |
stop()
Stop the component
|
protected java.util.Collection<java.lang.String> |
waitingForRetry() |
close, getProcessingExceptionService, hasConfiguredBehaviour, init, logErrorMessage, prepare, registeredWorkflows, registerEventHandler, registerWorkflow, setProcessingExceptionServicechangeState, getAlwaysHandleException, getParent, getUniqueId, notifyParent, onChildError, registerDigester, registerParent, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveDigester, setAlwaysHandleException, setUniqueIdprotected static final java.lang.String IS_RETRY_KEY
protected static final java.lang.String RETRY_COUNT_KEY
protected transient java.util.concurrent.ScheduledExecutorService executor
protected transient java.util.List<AdaptrisMessage> retryList
protected transient java.util.List<AdaptrisMessage> inProgress
public void handleProcessingException(AdaptrisMessage msg)
StandardProcessingExceptionHandlerHandles error messages from Workflows by sending them to the configured error producer. The best practice would be for the service to write the message to the filesystem, which is pretty unlikely to fail.
handleProcessingException in interface ProcessingExceptionHandlerhandleProcessingException in class StandardProcessingExceptionHandlermsg - the AdaptrisMessage to handlepublic 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 ComponentLifecyclestart in class StandardProcessingExceptionHandlerCoreException - wrapping any underlying Exceptionspublic 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 ComponentLifecyclestop in class StandardProcessingExceptionHandlerpublic void setRetryLimit(java.lang.Integer i)
i - the number of retries, if less than or equal to 0, then this is
considered to be an infinite number of retries.public java.lang.Integer getRetryLimit()
public TimeInterval getRetryInterval()
public void setRetryInterval(TimeInterval interval)
interval - the interval; default is 10 minutes if not explicitly configured.protected void failAllMessages()
protected void failFutureMessages(boolean failFuture)
protected java.util.Collection<java.lang.String> waitingForRetry()
protected void failMessage(java.lang.String s)
protected void failMessage(AdaptrisMessage msg)
protected void scheduleNextRun(AdaptrisMessage msg)