Class LargeMessageWorkflow
- java.lang.Object
-
- com.adaptris.core.WorkflowImp
-
- com.adaptris.core.StandardWorkflowImpl
-
- com.adaptris.core.StandardWorkflow
-
- com.adaptris.core.lms.LargeMessageWorkflow
-
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisMessageListener
,ComponentLifecycle
,ComponentLifecycleExtension
,ConfigComment
,EventHandlerAware
,StateManagedComponent
,Workflow
@ComponentProfile(summary="Workflow that supports arbitrarily large messages", tag="workflow,base") public class LargeMessageWorkflow extends StandardWorkflow
Workflow that does not store the original message for error-handling purposes.This workflow is intended to provide better performance when faced with extremely large messages. The behaviour of StandardWorkflow is to attempt to clone the message before attempting trigger the workflow; This can take an exceptionally long time if the message is greater than 300Mb, leading to a simple FsConsumer to FsProducer taking something like 300000ms.
While error handling is supported, the current message in transit is provided to the
ProcessingExceptionHandler
; so best practise when using this workflow is to immediately archive it withLargeFsProducer
and use that for recovery.In the adapter configuration file this class is aliased as large-message-workflow which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.WorkflowImp
eventHandler, log, startTime, stopTime
-
Fields inherited from interface com.adaptris.core.Workflow
PREVIOUS_GUID_KEY, WORKFLOW_ID_KEY
-
-
Constructor Summary
Constructors Constructor Description LargeMessageWorkflow()
Creates a new instance with defaults to prevent NullPointerExceptions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.protected void
resubmitMessage(AdaptrisMessage msg)
Resubmit a message upon the channel becoming available again.-
Methods inherited from class com.adaptris.core.StandardWorkflowImpl
closeWorkflow, handleMessage, initialiseWorkflow, prepareWorkflow, startWorkflow, stopWorkflow
-
Methods inherited from class com.adaptris.core.WorkflowImp
addConsumeLocation, addInterceptor, changeState, channelUnavailableWait, close, copyExceptionHeaders, disableMessageCount, doProduce, friendlyName, getChannelUnavailableWaitInterval, getComments, getConsumer, getDisableDefaultMessageCount, getInterceptors, getMessageErrorHandler, getMessageLogger, getProduceExceptionHandler, getProducer, getSendEvents, getServiceCollection, getUniqueId, handleBadMessage, handleBadMessage, handleChannelUnavailable, handleProduceException, init, lastStartTime, lastStopTime, logSuccess, messageLogger, obtainChannel, obtainWorkflowId, prepare, processingStart, registerActiveMsgErrorHandler, registerChannel, registerEventHandler, requestClose, requestInit, requestStart, requestStop, retrieveActiveMsgErrorHandler, retrieveComponentState, sendEvents, sendMessageLifecycleEvent, setChannelUnavailableWaitInterval, setComments, setConsumer, setDisableDefaultMessageCount, setInterceptors, setMessageErrorHandler, setMessageLogger, setProduceExceptionHandler, setProducer, setSendEvents, setServiceCollection, setUniqueId, start, stop, workflowEnd, workflowStart
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.AdaptrisMessageListener
onAdaptrisMessage, onAdaptrisMessage
-
-
-
-
Method Detail
-
onAdaptrisMessage
public void onAdaptrisMessage(AdaptrisMessage msg, java.util.function.Consumer<AdaptrisMessage> success, java.util.function.Consumer<AdaptrisMessage> failure)
Description copied from interface:AdaptrisMessageListener
Handle a message with call back actions if a message is successful or failed.- Specified by:
onAdaptrisMessage
in interfaceAdaptrisMessageListener
- Overrides:
onAdaptrisMessage
in classStandardWorkflow
- Parameters:
msg
- the messagesuccess
- called on successfailure
- called on failure
-
resubmitMessage
protected void resubmitMessage(AdaptrisMessage msg)
Description copied from class:WorkflowImp
Resubmit a message upon the channel becoming available again.- Overrides:
resubmitMessage
in classStandardWorkflowImpl
- Parameters:
msg
- the AdaptrisMessage.- See Also:
WorkflowImp.resubmitMessage(com.adaptris.core.AdaptrisMessage)
-
-