Package org.frankframework.receivers
Class Receiver<M>
java.lang.Object
org.frankframework.core.TransactionAttributes
org.frankframework.receivers.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
@Category("Basic")
public class Receiver<M>
extends TransactionAttributes
implements IManagable, IMessageHandler<M>, IProvidesMessageBrowsers<M>, EventThrowing, IbisExceptionListener, HasSender, HasStatistics, IThreadCountControllable
Wrapper for a listener that specifies a channel for the incoming messages of a specific
Apart from wrapping the listener, a
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
Transaction control
If
If the application or the server crashes in the middle of one or more transactions, these transactions
will be recovered and rolled back after the server/application is restarted. Then always exactly one of
the following applies for any message touched at any time by Ibis by a transacted receiver:
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 | errorSender | summary of effect |
---|---|---|---|---|---|
successful | message read and committed | message processed | unchanged | unchanged | message processed |
procesing failed | message read and committed | message processing failed and rolled back | unchanged | message sent | message only transferred from listener to errroSender |
listening failed | unchanged: listening rolled back | no processing performed | unchanged | unchanged | no changes, input message remains on input available for listener |
transfer to inprocess storage failed | unchanged: listening rolled back | no processing performed | unchanged | unchanged | no changes, input message remains on input available for listener |
transfer to errorSender failed | message read and committed | message processing failed and rolled back | message present | unchanged | message only transferred from listener to inProcess storage |
- It is processed correctly by the pipeline and removed from the input-queue, not present in inProcess storage and not send to the errorSender
- 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 or sent to the errorSender
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
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
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
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 TypeMethodDescriptionorg.frankframework.receivers.Receiver.ProcessResultCacheItem
cacheProcessResult
(String messageId, String errorMessage, Instant receivedDate) changeProcessState
(RawMessageWrapper<M> message, ProcessState toState, String reason) Change the processState of the message to the specified state, if that state is supported.protected void
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'boolean
void
This method is called by theIAdapter
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
(String messageId) This ClassLoader is set upon creation of the object, used to retrieve resources configured by the Ibis application.int
int
getDeliveryCount
(RawMessageWrapper<M> rawMessage) Iterable<io.micrometer.core.instrument.DistributionSummary>
Returns an iterator over the idle-statisticsprotected io.micrometer.core.instrument.DistributionSummary
getIdleStatistics
(int threadsProcessing) long
protected String
int
int
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
Iterable<io.micrometer.core.instrument.DistributionSummary>
Returns an iterator over the process-statisticsprotected io.micrometer.core.instrument.DistributionSummary
getProcessStatistics
(int threadsProcessing) Get therunstate
of this receiver.int
int
org.springframework.transaction.PlatformTransactionManager
void
increaseRetryIntervalAndWait
(Throwable t, String description) void
protected void
sends an informational message to the log and to the messagekeeper of the adapterboolean
boolean
boolean
isInRunState
(RunState someRunState) boolean
boolean
boolean
boolean
boolean
boolean
boolean
Provides the set of ProcessStates used by this listener.void
moveInProcessToError
(RawMessageWrapper<M> rawMessageWrapper, Map<String, Object> context, 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 duplicatesAlreadyChecked) Will use listener to performIListener.extractMessage(org.frankframework.receivers.RawMessageWrapper<M>, java.util.Map<java.lang.String, java.lang.Object>)
andIListener.afterMessageProcessed(org.frankframework.core.PipeLineResult, org.frankframework.receivers.RawMessageWrapper<M>, org.frankframework.core.PipeLineSession)
void
processRawMessage
(IListener<M> origin, RawMessageWrapper<M> rawMessage, PipeLineSession session, long waitingDuration, boolean duplicatesAlreadyChecked) Same asIMessageHandler.processRawMessage(IListener,RawMessageWrapper,PipeLineSession, boolean)
, but now updates IdleStatistics tooprocessRequest
(IListener<M> origin, RawMessageWrapper<M> rawMessage, Message message, PipeLineSession session) Process the received message withprocessRequest(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 defintions 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.void
setElementToMoveSessionKey
(String string) (Only used whenelementToMove
orelementToMoveChain
is set) Name of the session key wherein the character data is storedvoid
setErrorSender
(ISender errorSender) Sender that will send the result in case the PipeLineExit state was notSUCCESS
.void
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.void
setLabelNamespaceDefs
(String labelNamespaceDefs) Namespace defintions 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
setListenerContainer
(PullingListenerContainer<M> listenerContainer) void
setMaxDeliveries
(int i) The maximum delivery count after which to stop processing the message (only for listeners that know the delivery count of received messages).void
setMaxRetries
(int i) 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.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.void
setRunState
(RunState state) Changes runstate.void
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
startProcessingMessage
(long waitingDuration) void
Instruct the object that implementsIManagable
to start working.void
Instruct the object that implementsIManagable
to stop working.Provides the set of ProcessStates that a message in the specified state can be moved to, e.g.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 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
-
TXREQUIRED
public static final org.springframework.transaction.TransactionDefinition TXREQUIRED -
TXNEW_CTRL
public static final org.springframework.transaction.TransactionDefinition TXNEW_CTRL -
TXNEW_PROC
public org.springframework.transaction.TransactionDefinition TXNEW_PROC -
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:
-
MAX_RETRY_INTERVAL
public static final int MAX_RETRY_INTERVAL- 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 theIAdapter
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:
-
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 Description copied from interface:IHasProcessState
Change the processState of the message to the specified state, if that state is supported. If it is not supported, nothing changes, andfalse
is returned.- Specified by:
changeProcessState
in interfaceIHasProcessState<M>
- Returns:
- the moved message, or null if no message was moved.
- Throws:
ListenerException
-
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(long waitingDuration) -
finishProcessingMessage
protected void finishProcessingMessage(long processingDuration) -
moveInProcessToError
public void moveInProcessToError(RawMessageWrapper<M> rawMessageWrapper, Map<String, Object> context, 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.context
- Context of the process. Can be either the thread context of aIPullingListener
, or the currentPipeLineSession
.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 withprocessRequest(IListener, RawMessageWrapper, Message, PipeLineSession)
. A messageId is generated that is unique and consists of the name of this listener and a GUID 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 duplicatesAlreadyChecked) throws ListenerException Description copied from interface:IMessageHandler
Will use listener to performIListener.extractMessage(org.frankframework.receivers.RawMessageWrapper<M>, java.util.Map<java.lang.String, java.lang.Object>)
andIListener.afterMessageProcessed(org.frankframework.core.PipeLineResult, org.frankframework.receivers.RawMessageWrapper<M>, org.frankframework.core.PipeLineSession)
- Specified by:
processRawMessage
in interfaceIMessageHandler<M>
- Throws:
ListenerException
-
processRawMessage
public void processRawMessage(IListener<M> origin, RawMessageWrapper<M> rawMessage, @Nonnull PipeLineSession session, long waitingDuration, boolean duplicatesAlreadyChecked) throws ListenerException Description copied from interface:IMessageHandler
Same asIMessageHandler.processRawMessage(IListener,RawMessageWrapper,PipeLineSession, boolean)
, but now updates IdleStatistics too- Specified by:
processRawMessage
in interfaceIMessageHandler<M>
- Throws:
ListenerException
-
retryMessage
- Throws:
ListenerException
-
cacheProcessResult
-
getCachedErrorMessage
-
getDeliveryCount
-
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
-
resetRetryInterval
public void resetRetryInterval() -
increaseRetryIntervalAndWait
-
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
-
isStopped
public boolean isStopped() -
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>
-
getListenerContainer
-
setListenerContainer
-
createListenerContainer
-
getProcessStatistics
protected io.micrometer.core.instrument.DistributionSummary getProcessStatistics(int threadsProcessing) -
getIdleStatistics
protected io.micrometer.core.instrument.DistributionSummary getIdleStatistics(int threadsProcessing) -
getProcessStatistics
Returns an iterator over the process-statistics- Returns:
- iterator
-
getIdleStatistics
Returns an iterator over the idle-statistics- Returns:
- iterator
-
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. -
setSender
Sender to which the response (output ofPipeLine
) should be sent. Applies if the receiver has an asynchronous listener. N.B. Sending correlated responses via this sender is not supported. -
setErrorSender
Sender that will send the result in case the PipeLineExit state was notSUCCESS
. Applies if the receiver has an asynchronous listener. -
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
public void setMaxDeliveries(int i) The maximum delivery count after which to stop processing the message (only for listeners that know the delivery count of received messages). If -1 the delivery count is ignored- Default value
- 5
-
setMaxRetries
public void setMaxRetries(int i) 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
-
setProcessResultCacheSize
public void setProcessResultCacheSize(int processResultCacheSize) Size of the cache to keep process results, used by maxRetries- Default value
- 100
-
setReturnedSessionKeys
@Deprecated @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. -
setCorrelationIDXPath
XPath expression to extract correlationid from message -
setCorrelationIDNamespaceDefs
Namespace defintions 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 defintions 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. 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
-
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
-
getMaxDeliveries
public int getMaxDeliveries() -
getMaxRetries
public int getMaxRetries() -
getProcessResultCacheSize
public int getProcessResultCacheSize() -
isSupportProgrammaticRetry
public boolean isSupportProgrammaticRetry() -
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
-
getErrorSender
-
getMessageLog
-
getErrorStorage
-
getSender
-
setConfigurationMetrics
-
getTxManager
public org.springframework.transaction.PlatformTransactionManager getTxManager() -
setTxManager
public void setTxManager(org.springframework.transaction.PlatformTransactionManager txManager) -
setEventPublisher
-