@ComponentProfile(summary="JMS specific workflow that supports rollback of messages", tag="workflow,jms") public final class JmsTransactedWorkflow extends StandardWorkflow
StandardWorkflow
for use with JMS consumers.
This differs from a StandardWorkflow as it assumes that the configured JMS Consumer has a transacted session which needs to informed of any failures so the messages can be rolled back.
Additionally, this workflow may not be configured with any ProduceExceptionHandler
as this will not allow the transaction
to rolled back correctly. In order to get behaviour similiar to ProduceExceptionHandler
, you should use
StandaloneProducer
as part of the service collection in order to produce the payload to the required destination.
In the adapter configuration file this class is aliased as jms-transacted-workflow which is the preferred alternative to the fully qualified classname when building your configuration.
eventHandler, log, startTime, stopTime
PREVIOUS_GUID_KEY, WORKFLOW_ID_KEY
Constructor and Description |
---|
JmsTransactedWorkflow() |
Modifier and Type | Method and Description |
---|---|
void |
doProduce(AdaptrisMessage msg)
This method contains the behaviour that varies between standard and request -reply workflows.
|
java.lang.Boolean |
getStrict() |
TimeInterval |
getWaitPeriodAfterRollback() |
protected void |
handleBadMessage(java.lang.String logMsg,
java.lang.Exception e,
AdaptrisMessage msg) |
protected void |
initialiseWorkflow()
Initialise the workflow.
|
void |
setStrict(java.lang.Boolean strict)
Set the behaviour of this workflow with regards to failures.
|
void |
setWaitPeriodAfterRollback(TimeInterval interval)
set the amount of time to wait after issue a
Session.rollback() before continuing processing. |
long |
waitPeriodAfterRollbackMs() |
handleMessage, onAdaptrisMessage, resubmitMessage
closeWorkflow, prepareWorkflow, startWorkflow, stopWorkflow
addConsumeLocation, addInterceptor, changeState, channelUnavailableWait, close, copyExceptionHeaders, disableMessageCount, friendlyName, getChannelUnavailableWaitInterval, getComments, getConsumer, getDisableDefaultMessageCount, getInterceptors, getLogPayload, getMessageErrorHandler, getMessageLogger, getProduceExceptionHandler, getProducer, getSendEvents, getServiceCollection, getUniqueId, handleBadMessage, handleChannelUnavailable, handleProduceException, init, lastStartTime, lastStopTime, logSuccess, messageLogger, obtainChannel, obtainWorkflowId, prepare, processingStart, registerActiveMsgErrorHandler, registerChannel, registerEventHandler, requestClose, requestInit, requestStart, requestStop, retrieveActiveMsgErrorHandler, retrieveComponentState, sendMessageLifecycleEvent, setChannelUnavailableWaitInterval, setComments, setConsumer, setDisableDefaultMessageCount, setInterceptors, setLogPayload, setMessageErrorHandler, setMessageLogger, setProduceExceptionHandler, setProducer, setSendEvents, setServiceCollection, setUniqueId, start, stop, workflowEnd, workflowStart
protected void initialiseWorkflow() throws CoreException
WorkflowImp
initialiseWorkflow
in class StandardWorkflowImpl
CoreException
- encapsulating any underlying ExceptionWorkflowImp.initialiseWorkflow()
public void doProduce(AdaptrisMessage msg) throws ServiceException, ProduceException
WorkflowImp
This method contains the behaviour that varies between standard and request -reply workflows. It is overridden in
RequestReplyWorkflow
.
doProduce
in interface Workflow
doProduce
in class WorkflowImp
msg
- the message to processServiceException
- not thrown by this implementationProduceException
- if any occurprotected void handleBadMessage(java.lang.String logMsg, java.lang.Exception e, AdaptrisMessage msg)
handleBadMessage
in class WorkflowImp
public java.lang.Boolean getStrict()
public void setStrict(java.lang.Boolean strict)
When strict mode is enabled, then any exception will cause a rollback on
the session; when strict is false, then if a
ProcessingExceptionHandler
is configured that is not
NullProcessingExceptionHandler
, the session will not be rolled
back.
strict
- true or false (default true)public TimeInterval getWaitPeriodAfterRollback()
public long waitPeriodAfterRollbackMs()
public void setWaitPeriodAfterRollback(TimeInterval interval)
Session.rollback()
before continuing processing.interval
- the interval, default if not set is 30 seconds.