Class Receiver<M>
- All Implemented Interfaces:
HasSender
,HasTransactionAttribute
,IbisExceptionListener
,IConfigurable
,IConfigurationAware
,IHasProcessState<M>
,IManagable
,IMessageHandler<M>
,INamedObject
,IProvidesMessageBrowsers<M>
,IScopeProvider
,IThreadCountControllable
,EventThrowing
,HasStatistics
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
Adapter
.
By choosing a listener, the Frank developer determines how the messages are received.
For example, an ApiListener
receives RESTful HTTP requests and a
JavaListener
receives messages from direct Java calls.
Apart from wrapping the listener, a
Receiver
can be configured
to store received messages and to keep track of the processed / failed
status of these messages.
There are two kinds of listeners: synchronous listeners and asynchronous listeners. Synchronous listeners are expected to return a response. The system that triggers the receiver typically waits for a response before proceeding its operation. When a
ApiListener
receives a HTTP request, the listener is expected to return a
HTTP response. Asynchronous listeners are not expected to return a response. The system that
triggers the listener typically continues without waiting for the adapter to finish. When a
receiver contains an asynchronous listener, it can have a sender that sends the transformed
message to its destination. Receivers with an asynchronous listener can also have an error sender that is used
by the receiver to send error messages. In other words: if the result state is SUCCESS then the
message is sent by the ordinary sender, while the error sender is used if the result state
is ERROR.
Transaction control
If
transacted
is set to true
, messages will be received and processed under transaction control.
This means that after a message has been read and processed and the transaction has ended, one of the following apply:
situation | input listener | Pipeline | inProcess storage | summary of effect |
---|---|---|---|---|
successful | message read and committed | message processed | unchanged | message processed |
procesing failed | message read and committed | message processing failed and rolled back | unchanged | message only transferred from listener to errroSender |
listening failed | unchanged: listening rolled back | no processing performed | unchanged | no changes, input message remains on input available for listener |
transfer to inprocess storage failed | unchanged: listening rolled back | no processing performed | unchanged | no changes, input message remains on input available for listener |
- It is processed correctly by the pipeline and removed from the input-queue, not present in inProcess storage
- It is not processed at all by the pipeline, or processing by the pipeline has been rolled back; the message is removed from the input queue and either (one of) still in inProcess storage
commit or rollback
If transacted
is set to true
, messages will be either committed or rolled back.
All message-processing transactions are committed, unless one or more of the following apply:
- The PipeLine is transacted and the exitState of the pipeline is not equal to SUCCESS
- a PipeRunException or another runtime-exception has been thrown by any Pipe or by the PipeLine
- the setRollBackOnly() method has been called on the userTransaction (not accessible by Pipes)
- Since:
- 4.2
- Author:
- Gerrit van Brakel
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
protected static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Should be smaller than the transaction timeout as the delay takes place within the transaction.static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final int
static final String
static final String
protected final RunStateManager
static final String
static final String
static final org.springframework.transaction.TransactionDefinition
static final org.springframework.transaction.TransactionDefinition
static final org.springframework.transaction.TransactionDefinition
Fields inherited from class org.frankframework.core.TransactionAttributes
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected int
calculateAdjustedMaxBackoffDelay
(Integer configuredMaxBackoffDelay) changeProcessState
(RawMessageWrapper<M> message, ProcessState toState, String reason) Change message process state, via the listener of the receiver.protected void
Should only close resources when in state stopping (or error)!boolean
void
This method is called by theAdapter
to let the receiver do things to initialize itself before thestartListening
method is called.void
protected void
sends a error message to the log and to the messagekeeper of the adaptervoid
exceptionThrown
(String errorMessage, Throwable t) void
exceptionThrown
(INamedObject object, Throwable t) Inform the implementing class that the exceptiont
occurred inobject
.protected void
finishProcessingMessage
(long processingDuration) formatException
(String extraInfo, String messageId, Message message, Throwable t) Formats any exception thrown by any of the above methods to a message that can be returned.org.springframework.context.ApplicationContext
getCachedErrorMessage
(RawMessageWrapper<M> rawMessageWrapper) This ClassLoader is set upon creation of the object, used to retrieve resources configured by the Ibis application.int
int
getDeliveryCount
(RawMessageWrapper<M> rawMessage) Get the delivery-count for the message.long
protected String
int
getMessageBrowser
(ProcessState state) returns abrowser
of messages that are in ProcessState 'state', and are stored in a storage managed by the listener itself (as opposed to a storage configured as a messageLog or errorStorage in the configuration).double
get the number of messages received by this receiver.double
Get the number of messages rejected (discarded or put in errorStorage).double
get the number of duplicate messages received this receiver.getName()
int
int
int
int
protected io.micrometer.core.instrument.DistributionSummary
getProcessStatistics
(int threadsProcessing) Get therunstate
of this receiver.int
int
org.springframework.transaction.PlatformTransactionManager
void
increaseBackoffIntervalAndWait
(Throwable t, String description) void
protected void
sends an informational message to the log and to the messagekeeper of the adapterboolean
protected boolean
isDeliveryRetryLimitExceededAfterMessageProcessed
(RawMessageWrapper<M> messageWrapper) Returns true if the message should no longer be retried after it has failed in processing.protected boolean
isDeliveryRetryLimitExceededBeforeMessageProcessing
(RawMessageWrapper<M> rawMessageWrapper, PipeLineSession session, boolean manualRetry) returns true if message should not be processed when it is delivered.boolean
boolean
isInRunState
(RunState someRunState) boolean
boolean
boolean
boolean
supportProgrammaticRetry is set totrue
internally during configuration when the listener implementsIHasProcessState
, and is configured with process stateProcessState.INPROCESS
.boolean
boolean
Provides the set of ProcessStates used by this listener.void
moveInProcessToError
(RawMessageWrapper<M> rawMessageWrapper, PipeLineSession session, Instant receivedDate, String comments, org.springframework.transaction.TransactionDefinition txDef) Move a message from the "in process" state or storage, to the error state or storage.protected void
void
processRawMessage
(IListener<M> origin, RawMessageWrapper<M> rawMessage, PipeLineSession session, boolean retryStatusAlreadyChecked) This method processes the raw message from the listener.processRequest
(IListener<M> origin, RawMessageWrapper<M> rawMessage, Message message, PipeLineSession session) Process the received message withIMessageHandler.processRequest(IListener, RawMessageWrapper, Message, PipeLineSession)
.protected void
void
void
void
retryMessage
(String storageKey) void
setAdapter
(Adapter adapter) void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setCheckForDuplicates
(boolean b) If set totrue
, each message is checked for presence in the messageLog.void
(Only used whencheckForDuplicates=true
) Indicates whether the messageid or the correlationid is used for checking presence in the message logvoid
setChompCharSize
(String string) If set (>=0) and the character data length inside a xml element exceeds this size, the character data is chomped (with a clear comment)void
setConfigurationMetrics
(MetricsInitializer configurationMetrics) void
setCorrelationIDNamespaceDefs
(String correlationIDNamespaceDefs) Namespace definitions for correlationIDXPath.void
setCorrelationIDStyleSheet
(String string) Stylesheet to extract correlationID from messagevoid
setCorrelationIDXPath
(String string) XPath expression to extract correlationId from messagevoid
setElementToMove
(String string) If set, the character data in this XML element is stored inside a session key and in the message it is replaced by a reference to this session key:{sessionKey: elementToMoveSessionKey}
void
setElementToMoveChain
(String string) LikeelementToMove
but element is preceded with all ancestor elements and separated by semicolons (e.g. adapter;pipeline;pipe)void
setElementToMoveSessionKey
(String string) (Only used whenelementToMove
orelementToMoveChain
is set) Name of the session key wherein the character data is storedvoid
setErrorStorage
(ITransactionalStorage<Serializable> errorStorage) Storage to keep track of messages that failed processingvoid
setEventPublisher
(EventPublisher eventPublisher) void
setForceRetryFlag
(boolean b) If set totrue
, every message read will be processed as if it is being retried, by setting a session variable to "retry".void
setHiddenInputSessionKeys
(String string) Comma separated list of keys of session variables which are available when thePipelineSession
is created and of which the value will not be shown in the log (replaced by asterisks)void
setHideMethod
(IMessageBrowser.HideMethod hideMethod) Only used when hideRegex is not emptyvoid
setHideRegex
(String hideRegex) Regular expression to mask strings in the errorStore/logStore and logfiles.void
setLabelNamespaceDefs
(String labelNamespaceDefs) Namespace definitions for labelXPath.void
setLabelStyleSheet
(String string) Stylesheet to extract label from messagevoid
setLabelXPath
(String string) XPath expression to extract label from messagevoid
setListener
(IListener<M> newListener) Sets the listener used to receive messages from.void
setMaxBackoffDelay
(Integer maxBackoffDelaySeconds) After a message has an error in processing, there is a small delay before processing the next message before processing the next message or retrying the failed message.void
Deprecated, for removal: This API element is subject to removal in a future version.void
The number of times a processing attempt is automatically retried after an exception is caught or rollback is experienced.void
setMessageLog
(ITransactionalStorage<Serializable> messageLog) Storage to keep track of all messages processed correctlyvoid
Sets the name of the Receiver, as known to the Adapter.void
Number of connection attempts to put the adapter in warning statusvoid
setNumThreads
(int newNumThreads) The number of threads that may execute a Pipeline concurrently (only for pulling listeners)void
setNumThreadsPolling
(int i) The number of threads that are actively polling for messages concurrently. '0' means 'limited only bynumthreads
' (only for pulling listeners)void
setOnError
(Receiver.OnError value) One of 'continue', 'recover' or 'close'.void
setPollInterval
(int i) The number of seconds waited after an unsuccessful poll attempt, before another poll attempt is made.void
setProcessResultCacheSize
(int processResultCacheSize) Size of the cache to keep process results, used by maxRetriesvoid
setRemoveCompactMsgNamespaces
(boolean b) void
setReturnedSessionKeys
(String string) Deprecated, for removal: This API element is subject to removal in a future version.void
setRunState
(RunState state) Changes runstate.void
setSender
(ICorrelatedSender sender) Sender to which the response (output ofPipeLine
) should be sent.void
setStartTimeout
(int i) timeout (in seconds) to start receiver.void
setStopTimeout
(int i) timeout (in seconds) to stop receiver.void
setTxManager
(org.springframework.transaction.PlatformTransactionManager txManager) protected void
void
Instruct the object that implementsIManagable
to start working.void
Instruct the object that implementsIManagable
to stop working.protected void
suspendReceiverThread
(int delayTimeInSeconds) Suspend the receiver fordelayTimeInSeconds
secondsProvides the set of ProcessStates that a message in the specified state can be moved to, e.g. from a MessageBrowser for that state.protected void
must lead to a 'closeAllResources()' and runstate must be 'STOPPING' if IPushingListener -> call closeAllResources() if IPullingListener -> PullingListenerContainer has to call closeAllResources();protected void
throwEvent
(String eventCode) toString()
Returns a toString of this class by introspection and the toString() value of its listener.protected Receiver.ProcessStatusCacheItem
updateMessageReceiveCount
(RawMessageWrapper<M> rawMessageWrapper) Call this method exactly once per every try to process a message to initialize the internally cached receive-count for the messageId.protected void
sends a warning to the log and to the messagekeeper of the adapterMethods inherited from class org.frankframework.core.TransactionAttributes
configureTransactionAttributes, getTransactionAttribute, getTransactionTimeout, getTxDef, isTransacted, isTransacted, setTransacted, setTransactionAttribute, setTransactionTimeout
-
Field Details
-
TXSUPPORTED
public static final org.springframework.transaction.TransactionDefinition TXSUPPORTED -
TXREQUIRED
public static final org.springframework.transaction.TransactionDefinition TXREQUIRED -
TXNEW_CTRL
public static final org.springframework.transaction.TransactionDefinition TXNEW_CTRL -
THREAD_CONTEXT_KEY_NAME
- See Also:
-
THREAD_CONTEXT_KEY_TYPE
- See Also:
-
RCV_CONFIGURED_MONITOR_EVENT
- See Also:
-
RCV_CONFIGURATIONEXCEPTION_MONITOR_EVENT
- See Also:
-
RCV_STARTED_RUNNING_MONITOR_EVENT
- See Also:
-
RCV_SHUTDOWN_MONITOR_EVENT
- See Also:
-
RCV_SUSPENDED_MONITOR_EVENT
- See Also:
-
RCV_RESUMED_MONITOR_EVENT
- See Also:
-
RCV_THREAD_EXIT_MONITOR_EVENT
- See Also:
-
RCV_MESSAGE_TO_ERRORSTORE_EVENT
- See Also:
-
RCV_MESSAGE_LOG_COMMENTS
- See Also:
-
RCV_SUSPENSION_MESSAGE_THRESHOLD
public static final int RCV_SUSPENSION_MESSAGE_THRESHOLD- See Also:
-
DEFAULT_MAX_BACKOFF_DELAY_KEY
- See Also:
-
DEFAULT_MAX_BACKOFF_DELAY
public static final int DEFAULT_MAX_BACKOFF_DELAYShould be smaller than the transaction timeout as the delay takes place within the transaction. WebSphere default transaction timeout is 120.- See Also:
-
RETRY_FLAG_SESSION_KEY
- See Also:
-
runState
-
-
Constructor Details
-
Receiver
public Receiver()
-
-
Method Details
-
configurationSucceeded
public boolean configurationSucceeded() -
getLogPrefix
-
info
sends an informational message to the log and to the messagekeeper of the adapter -
warn
sends a warning to the log and to the messagekeeper of the adapter -
error
sends a error message to the log and to the messagekeeper of the adapter -
openAllResources
- Throws:
ListenerException
TimeoutException
-
tellResourcesToStop
protected void tellResourcesToStop()must lead to a 'closeAllResources()' and runstate must be 'STOPPING' if IPushingListener -> call closeAllResources() if IPullingListener -> PullingListenerContainer has to call closeAllResources(); -
closeAllResources
protected void closeAllResources()Should only close resources when in state stopping (or error)! this should be the only trigger to change the state to stopped On exit resources must be 'closed' so the receiver RunState can be set to 'STOPPED' -
propagateName
protected void propagateName() -
configure
This method is called by theAdapter
to let the receiver do things to initialize itself before thestartListening
method is called.- Specified by:
configure
in interfaceIConfigurable
- Overrides:
configure
in classTransactionAttributes
- Throws:
ConfigurationException
- when initialization did not succeed.- See Also:
-
calculateAdjustedMaxBackoffDelay
-
startRunning
public void startRunning()Description copied from interface:IManagable
Instruct the object that implementsIManagable
to start working. The method does not wait for completion of the command; at return of this method, the object might be still in the STARTING-runstate- Specified by:
startRunning
in interfaceIManagable
-
stopRunning
public void stopRunning()Description copied from interface:IManagable
Instruct the object that implementsIManagable
to stop working. The method does not wait for completion of the command; at return of this method, the object might be still in the STOPPING-runstate- Specified by:
stopRunning
in interfaceIManagable
-
knownProcessStates
Description copied from interface:IHasProcessState
Provides the set of ProcessStates used by this listener.- Specified by:
knownProcessStates
in interfaceIHasProcessState<M>
-
targetProcessStates
Description copied from interface:IHasProcessState
Provides the set of ProcessStates that a message in the specified state can be moved to, e.g. from a MessageBrowser for that state.- Specified by:
targetProcessStates
in interfaceIHasProcessState<M>
-
changeProcessState
public RawMessageWrapper<M> changeProcessState(RawMessageWrapper<M> message, ProcessState toState, String reason) throws ListenerException Change message process state, via the listener of the receiver. The listener must supportIHasProcessState
. As an extra side-effect of this method implementation, if thetoState
isProcessState.AVAILABLE
then any recorded processing history status is reset so that a message can be manually retried.- Specified by:
changeProcessState
in interfaceIHasProcessState<M>
- Parameters:
message
- Message for which to change state.toState
- Desired state of the messagereason
- Reason for changing the state- Returns:
- Updated message
- Throws:
ListenerException
- thrown if changing the state by the listener fails.IllegalStateException
- thrown if the listener does not support changing process states.
-
getMessageBrowser
Description copied from interface:IProvidesMessageBrowsers
returns abrowser
of messages that are in ProcessState 'state', and are stored in a storage managed by the listener itself (as opposed to a storage configured as a messageLog or errorStorage in the configuration).- Specified by:
getMessageBrowser
in interfaceIProvidesMessageBrowsers<M>
-
startProcessingMessage
protected void startProcessingMessage() -
finishProcessingMessage
protected void finishProcessingMessage(long processingDuration) -
moveInProcessToError
public void moveInProcessToError(RawMessageWrapper<M> rawMessageWrapper, PipeLineSession session, Instant receivedDate, String comments, org.springframework.transaction.TransactionDefinition txDef) Move a message from the "in process" state or storage, to the error state or storage.- Parameters:
rawMessageWrapper
- Wrapper for the raw message, may be an instance ofRawMessageWrapper
orMessageWrapper
. If an instance ofRawMessageWrapper
then theIListener
will be used to extract the fullMessage
object to be sent to the error storage.session
-PipeLineSession
of the process.receivedDate
- Timestamp of when the message was received.comments
- Processing comments and error message regarding the reason the message was rejected.txDef
-TransactionDefinition
for the transaction to be used for moving the message to error state / storage.
-
processRequest
public Message processRequest(IListener<M> origin, @Nonnull RawMessageWrapper<M> rawMessage, @Nonnull Message message, @Nonnull PipeLineSession session) throws ListenerException Process the received message withIMessageHandler.processRequest(IListener, RawMessageWrapper, Message, PipeLineSession)
.
A messageId is generated that is unique and consists of the name of this listener and a GUID.If the receiver is transactional, then this method will enforce the transactional requirements specified by
TransactionAttributes.setTransactionAttribute(TransactionAttribute)
.N.B. callers of this method should clear the remaining ThreadContext if it's not to be returned to their callers.
- Specified by:
processRequest
in interfaceIMessageHandler<M>
- Throws:
ListenerException
-
processRawMessage
public void processRawMessage(IListener<M> origin, RawMessageWrapper<M> rawMessage, @Nonnull PipeLineSession session, boolean retryStatusAlreadyChecked) throws ListenerException This method processes the raw message from the listener.
The method assumes that a transaction has been started where necessary.- Specified by:
processRawMessage
in interfaceIMessageHandler<M>
- Throws:
ListenerException
-
retryMessage
- Throws:
ListenerException
-
updateMessageReceiveCount
@Nonnull protected Receiver.ProcessStatusCacheItem updateMessageReceiveCount(@Nonnull RawMessageWrapper<M> rawMessageWrapper) Call this method exactly once per every try to process a message to initialize the internally cached receive-count for the messageId. If the listener implementsIKnowsDeliveryCount
then the receiveCount will be set to theIKnowsDeliveryCount.getDeliveryCount(RawMessageWrapper)
.- Parameters:
rawMessageWrapper
- The raw message for which to set the receiveCount.
-
getCachedErrorMessage
-
getDeliveryCount
Get the delivery-count for the message. If the listener implementsIKnowsDeliveryCount
then get the delivery count from the listener, otherwise get it from the internal process-result cache.- Parameters:
rawMessage
-RawMessageWrapper
for which to retrieve the delivery count- Returns:
- Number of times the message has been delivered, minimum is always 1 (for the first delivery of the message).
-
isDeliveryRetryLimitExceededAfterMessageProcessed
protected boolean isDeliveryRetryLimitExceededAfterMessageProcessed(@Nonnull RawMessageWrapper<M> messageWrapper) Returns true if the message should no longer be retried after it has failed in processing.- Parameters:
messageWrapper
- Message for which to check delivery count- Returns:
true
if message should no longer be retried,false
if it should.
-
isDeliveryRetryLimitExceededBeforeMessageProcessing
protected boolean isDeliveryRetryLimitExceededBeforeMessageProcessing(RawMessageWrapper<M> rawMessageWrapper, PipeLineSession session, boolean manualRetry) throws ListenerException returns true if message should not be processed when it is delivered.- Throws:
ListenerException
-
exceptionThrown
Description copied from interface:IbisExceptionListener
Inform the implementing class that the exceptiont
occurred inobject
.- Specified by:
exceptionThrown
in interfaceIbisExceptionListener
-
exceptionThrown
-
getEventSourceName
- Specified by:
getEventSourceName
in interfaceEventThrowing
-
throwEvent
-
resetBackoffDelay
public void resetBackoffDelay() -
increaseBackoffIntervalAndWait
-
suspendReceiverThread
protected void suspendReceiverThread(int delayTimeInSeconds) Suspend the receiver fordelayTimeInSeconds
seconds- Parameters:
delayTimeInSeconds
- Number of seconds the receiver thread should be suspended from processing new messages.
-
isThreadCountReadable
public boolean isThreadCountReadable()- Specified by:
isThreadCountReadable
in interfaceIThreadCountControllable
-
isThreadCountControllable
public boolean isThreadCountControllable()- Specified by:
isThreadCountControllable
in interfaceIThreadCountControllable
-
getCurrentThreadCount
public int getCurrentThreadCount()- Specified by:
getCurrentThreadCount
in interfaceIThreadCountControllable
-
getMaxThreadCount
public int getMaxThreadCount()- Specified by:
getMaxThreadCount
in interfaceIThreadCountControllable
-
increaseThreadCount
public void increaseThreadCount()- Specified by:
increaseThreadCount
in interfaceIThreadCountControllable
-
decreaseThreadCount
public void decreaseThreadCount()- Specified by:
decreaseThreadCount
in interfaceIThreadCountControllable
-
setRunState
Changes runstate. Always stops the receiver when state is `**ERROR**` -
getRunState
Get therunstate
of this receiver.- Specified by:
getRunState
in interfaceIManagable
-
isInRunState
-
formatException
Description copied from interface:IMessageHandler
Formats any exception thrown by any of the above methods to a message that can be returned. Can be used if the calling system has no other way of returning the exception to the caller.- Specified by:
formatException
in interfaceIMessageHandler<M>
-
getProcessStatistics
protected io.micrometer.core.instrument.DistributionSummary getProcessStatistics(int threadsProcessing) -
isOnErrorContinue
public boolean isOnErrorContinue() -
getMessagesReceived
public double getMessagesReceived()get the number of messages received by this receiver. -
getMessagesRetried
public double getMessagesRetried()get the number of duplicate messages received this receiver. -
getMessagesRejected
public double getMessagesRejected()Get the number of messages rejected (discarded or put in errorStorage). -
getLastMessageDate
public long getLastMessageDate() -
resetNumberOfExceptionsCaughtWithoutMessageBeingReceived
public void resetNumberOfExceptionsCaughtWithoutMessageBeingReceived() -
toString
Returns a toString of this class by introspection and the toString() value of its listener. -
setListener
Sets the listener used to receive messages from. -
setErrorStorage
Storage to keep track of messages that failed processing -
setMessageLog
Storage to keep track of all messages processed correctly -
setName
Sets the name of the Receiver, as known to the Adapter. If the listener implements thename
interface andgetName()
of the listener is empty, the name of this object is given to the listener.- Specified by:
setName
in interfaceINamedObject
-
setOnError
One of 'continue', 'recover' or 'close'. Controls the behaviour of the Receiver, when it encounters an error during processing of a message.- Default value
- CONTINUE
-
setNumThreads
public void setNumThreads(int newNumThreads) The number of threads that may execute a Pipeline concurrently (only for pulling listeners)- Default value
- 1
-
setNumThreadsPolling
public void setNumThreadsPolling(int i) The number of threads that are actively polling for messages concurrently. '0' means 'limited only bynumthreads
' (only for pulling listeners)- Default value
- 1
-
setPollInterval
public void setPollInterval(int i) The number of seconds waited after an unsuccessful poll attempt, before another poll attempt is made. Only for polling listeners, not for e.g. jms, webservice or javaListeners- Default value
- 10
-
setStartTimeout
public void setStartTimeout(int i) timeout (in seconds) to start receiver. If this timeout is exceeded, the Receiver startup is aborted and all resources closed and the receiver will be in stateEXCEPTION_STARTING
and a new start command may be issued again. -
setStopTimeout
public void setStopTimeout(int i) timeout (in seconds) to stop receiver. If this timeout is exceeded, stopping will be aborted and the receiver will be in stateEXCEPTION_STOPPING
. The receiver will no longer be running but some resources might not have been cleaned up properly. -
setCheckForDuplicates
public void setCheckForDuplicates(boolean b) If set totrue
, each message is checked for presence in the messageLog. If already present, it is not processed again. Only required for non XA compatible messaging. Requires messageLog!- Default value
- false
-
setCheckForDuplicatesMethod
(Only used whencheckForDuplicates=true
) Indicates whether the messageid or the correlationid is used for checking presence in the message log- Default value
- MESSAGEID
-
setMaxDeliveries
@Deprecated(forRemoval=true, since="9.0") @ConfigurationWarning("This property has been deprecated, please use maxRetries instead.") public void setMaxDeliveries(Integer i) Deprecated, for removal: This API element is subject to removal in a future version.The maximum retry count after which to stop processing the message. If equal to or lower than 0, the retry count is ignored. This property is deprecated -- usemaxRetries
instead. Until removal of this property, the code will treat this property as the same asmaxRetries
. If both are set in a configuration, then the highest value is used. -
setMaxRetries
The number of times a processing attempt is automatically retried after an exception is caught or rollback is experienced. IfmaxRetries < 0
the number of attempts is infinite- Default value
- 1, or 3 for JMS Listeners or other listeners implementing
IKnowsDeliveryCount
.
-
setProcessResultCacheSize
public void setProcessResultCacheSize(int processResultCacheSize) Size of the cache to keep process results, used by maxRetries- Default value
- 100
-
setReturnedSessionKeys
@Deprecated(forRemoval=true, since="7.9.0") @ConfigurationWarning("attribute is no longer used. Please use attribute returnedSessionKeys of the JavaListener if the set of sessionsKeys that can be returned to callers session must be limited.") public void setReturnedSessionKeys(String string) Deprecated, for removal: This API element is subject to removal in a future version. -
setCorrelationIDXPath
XPath expression to extract correlationId from message -
setCorrelationIDNamespaceDefs
Namespace definitions for correlationIDXPath. Must be in the form of a comma or space separated list ofprefix=namespaceuri
-definitions -
setCorrelationIDStyleSheet
Stylesheet to extract correlationID from message -
setLabelXPath
XPath expression to extract label from message -
setLabelNamespaceDefs
Namespace definitions for labelXPath. Must be in the form of a comma or space separated list ofprefix=namespaceuri
-definitions -
setLabelStyleSheet
Stylesheet to extract label from message -
setChompCharSize
If set (>=0) and the character data length inside a xml element exceeds this size, the character data is chomped (with a clear comment) -
setElementToMove
If set, the character data in this XML element is stored inside a session key and in the message it is replaced by a reference to this session key:{sessionKey: elementToMoveSessionKey}
-
setElementToMoveSessionKey
(Only used whenelementToMove
orelementToMoveChain
is set) Name of the session key wherein the character data is stored- Default value
- ref_ + the name of the element
-
setElementToMoveChain
LikeelementToMove
but element is preceded with all ancestor elements and separated by semicolons (e.g. adapter;pipeline;pipe) -
setRemoveCompactMsgNamespaces
public void setRemoveCompactMsgNamespaces(boolean b) -
setHideRegex
Regular expression to mask strings in the errorStore/logStore and logfiles. Every character between to the strings in this expression will be replaced by a '*'. For example, the regular expression (?<=<party>).*?(?=</party>) will replace every character between keys <party> and </party> -
setHideMethod
Only used when hideRegex is not empty- Default value
- all
-
setHiddenInputSessionKeys
Comma separated list of keys of session variables which are available when thePipelineSession
is created and of which the value will not be shown in the log (replaced by asterisks) -
setForceRetryFlag
public void setForceRetryFlag(boolean b) If set totrue
, every message read will be processed as if it is being retried, by setting a session variable to "retry".- Default value
- false
-
setNumberOfExceptionsCaughtWithoutMessageBeingReceivedThreshold
public void setNumberOfExceptionsCaughtWithoutMessageBeingReceivedThreshold(int number) Number of connection attempts to put the adapter in warning status- Default value
- 5
-
setMaxBackoffDelay
After a message has an error in processing, there is a small delay before processing the next message before processing the next message or retrying the failed message. This is so that errors coming from external systems so not overload those external systems.The delay doubles after every failure, until the maximum set here is reached. See: https://en.wikipedia.org/wiki/Exponential_backoff.
If the transaction timeout can be determined, then the backoff-delay is capped by half the transaction timeout to avoid messages automatically timing out.
There is no backoff-time after a message is successfully processed. After a message is successfully processed, the actual backoff-time is reset to 1 second.
If set to 0, then there is no delay after messages that had an error.
If this is not set on the receiver, then a default is taken from the configuration property ${receiver.defaultMaxBackoffDelay} which defaults to 60 seconds.
- Parameters:
maxBackoffDelaySeconds
- Maximum backoff-time in seconds before retrying a message, after an error occurred during processing.
-
getConfigurationClassLoader
Description copied from interface:IScopeProvider
This ClassLoader is set upon creation of the object, used to retrieve resources configured by the Ibis application.- Specified by:
getConfigurationClassLoader
in interfaceIScopeProvider
- Returns:
- returns the ClassLoader created by the
ClassLoaderManager
.
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()- Specified by:
getApplicationContext
in interfaceIConfigurationAware
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-
getOnError
-
getName
- Specified by:
getName
in interfaceIConfigurationAware
- Specified by:
getName
in interfaceINamedObject
-
getNumThreads
public int getNumThreads() -
getNumThreadsPolling
public int getNumThreadsPolling() -
getPollInterval
public int getPollInterval() -
getStartTimeout
public int getStartTimeout() -
getStopTimeout
public int getStopTimeout() -
isForceRetryFlag
public boolean isForceRetryFlag() -
isCheckForDuplicates
public boolean isCheckForDuplicates() -
getCheckForDuplicatesMethod
-
getMaxRetries
-
getProcessResultCacheSize
public int getProcessResultCacheSize() -
isSupportProgrammaticRetry
public boolean isSupportProgrammaticRetry()supportProgrammaticRetry is set totrue
internally during configuration when the listener implementsIHasProcessState
, and is configured with process stateProcessState.INPROCESS
. In all other circumstances, it isfalse
. -
getCorrelationIDXPath
-
getCorrelationIDNamespaceDefs
-
getCorrelationIDStyleSheet
-
getLabelXPath
-
getLabelNamespaceDefs
-
getLabelStyleSheet
-
getChompCharSize
-
getElementToMove
-
getElementToMoveSessionKey
-
getElementToMoveChain
-
isRemoveCompactMsgNamespaces
public boolean isRemoveCompactMsgNamespaces() -
getHideRegex
-
getHideMethod
-
getHiddenInputSessionKeys
-
isNumberOfExceptionsCaughtWithoutMessageBeingReceivedThresholdReached
public boolean isNumberOfExceptionsCaughtWithoutMessageBeingReceivedThresholdReached() -
getAdapter
- Specified by:
getAdapter
in interfaceEventThrowing
- Specified by:
getAdapter
in interfaceHasStatistics
-
setAdapter
-
getListener
-
getMessageLog
-
getErrorStorage
-
getSender
-
setConfigurationMetrics
-
getTxManager
public org.springframework.transaction.PlatformTransactionManager getTxManager() -
setTxManager
public void setTxManager(org.springframework.transaction.PlatformTransactionManager txManager) -
setEventPublisher
-