public class MessageStoreListener<M> extends JdbcTableListener<M>
MessageStoreSender
.
Example configuration:
<Receiver
name="03 MessageStoreReceiver"
numThreads="4"
transactionAttribute="Required"
pollInterval="1"
>
<MessageStoreListener
name="03 MessageStoreListener"
slotId="${instance.name}/TestMessageStore"
statusValueInProcess="I"
/>
</Receiver>
If you have a MessageStoreListener
, failed messages are automatically kept in database
table IBISSTORE. Messages are also kept after successful processing. The state of a message
is distinguished by the TYPE
field, as follows:
M
: The message is new. From a functional perspective, it is in the message store.
E
: There was an error processing the message. From a functional perspective, it is in the error store.
A
: The message was successfully processed. From a functional perspective, it is in the message log.
MessageStoreListener
acts as a message log and as an error store.
If you have it, you do not need to add
a JdbcErrorStorage
or JdbcMessageLog
within the same receiver.
JdbcListener.MessageFieldType
HasStatistics.Action
connection
Constructor and Description |
---|
MessageStoreListener() |
Modifier and Type | Method and Description |
---|---|
protected IMessageBrowser<M> |
augmentMessageBrowser(IMessageBrowser<M> browser) |
void |
configure()
configure() is called once at startup of the framework in the configure() method
of the owner of this listener. |
Message |
extractMessage(RawMessageWrapper<M> rawMessage,
Map<String,Object> context)
Extracts data from message obtained from
IPullingListener.getRawMessage(Map) or
IPushingListener.wrapRawMessage(Object, PipeLineSession) . |
void |
extractSessionKeyList() |
IMessageBrowser<M> |
getMessageBrowser(ProcessState state)
returns a
browser 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). |
String |
getSelectCondition() |
void |
setBlobSmartGet(boolean b)
Controls automatically whether blobdata is stored compressed and/or serialized in the database.
|
void |
setCommentField(String commentField)
(optional) Field used to store the reason of the last change of the statusField
|
void |
setCorrelationIdField(String fieldname)
Field containing the correlationId
|
void |
setKeyField(String fieldname)
Primary key field of the table, used to identify messages.
|
void |
setMessageField(String fieldname)
Field containing the message data
|
void |
setMessageFieldType(JdbcListener.MessageFieldType fieldtype)
Type of the field containing the message data
|
void |
setMessageIdField(String fieldname)
Field containing the message Id
|
void |
setMoveToMessageLog(boolean moveToMessageLog)
Move to messageLog after processing, as the message is already stored in the ibisstore only some fields need to be updated.
|
void |
setSessionKeys(String sessionKeys)
Comma separated list of sessionKey's to be read together with the message.
|
void |
setSlotId(String slotId)
Identifier for this service
|
void |
setStatusField(String fieldname)
Field containing the status of the message.
|
void |
setStatusValueAvailable(String string)
Value of statusField indicating row is available to be processed.
|
void |
setStatusValueError(String string)
Value of statusField indicating the processing of the row resulted in an error
|
void |
setStatusValueHold(String string)
Value of status field indicating message is on Hold, temporarily.
|
void |
setStatusValueInProcess(String string)
Value of status field indicating is being processed.
|
void |
setStatusValueProcessed(String string)
Value of status field indicating row is processed OK
|
void |
setTableName(String string)
Name of the table to be used
|
void |
setTimestampField(String fieldname)
(optional) Field used to store the date and time of the last change of the statusField
|
changeProcessState, createUpdateStatusQuery, getPhysicalDestinationName, getStatusValue, getStorageType, setMaxCommentLength, setOrderField, setSelectCondition, setTableAlias
afterMessageProcessed, changeProcessState, close, closeThread, convertQuery, execute, extractRawMessage, getKeyFromRawMessage, getRawMessage, getRawMessage, getUpdateStatusQuery, hasRawMessageAvailable, hasRawMessageAvailable, knownProcessStates, open, openThread, setBlobCharset, setBlobsCompressed, setPeekQuery, setPeekUntransacted, setSelectQuery, setSqlDialect, setTrace, setUpdateStatusQuery, targetProcessStates
getAuthAlias, getConnection, getConnectionWithTimeout, getDatasource, getDatasourceInfo, getDatasourceName, getDbmsSupport, getLogPrefix, getPassword, getUsername, isConnectionsArePooled, isTransacted, iterateOverStatistics, setAuthAlias, setConnectionsArePooled, setDatasourceName, setDbmsSupportFactory, setJmsRealm, setPassword, setTransacted, setUsername
getContext, getJndiEnv, setAuthentication, setCredentials, setInitialContextFactoryName, setJndiAuthAlias, setJndiContextPrefix, setJndiProperties, setName, setPrincipal, setProviderURL, setSecurityProtocol, setUrlPkgPrefixes, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
changeProcessState, knownProcessStates, targetProcessStates
isPeekUntransacted
getName, setName
getApplicationContext, getName
getConfigurationClassLoader
setApplicationContext
getDomain
public void configure() throws ConfigurationException
IListener
configure()
is called once at startup of the framework in the configure()
method
of the owner of this listener.
Purpose of this method is to reduce creating connections to databases etc. in the IPullingListener.getRawMessage(Map)
method.
As much as possible class-instantiating should take place in the
configure()
or open()
method, to improve performance.configure
in interface IConfigurable
configure
in interface IListener<M>
configure
in class JdbcTableListener<M>
ConfigurationException
public void extractSessionKeyList()
public Message extractMessage(@Nonnull RawMessageWrapper<M> rawMessage, @Nonnull Map<String,Object> context) throws ListenerException
IListener
IPullingListener.getRawMessage(Map)
or
IPushingListener.wrapRawMessage(Object, PipeLineSession)
. May also extract
other parameters from the message and put those into the context.extractMessage
in interface IListener<M>
extractMessage
in class JdbcListener<M>
rawMessage
- The RawMessageWrapper
from which to extract the Message
.context
- Context to populate. Either a PipeLineSession
or a Map
threadContext depending on caller.Message
for adapter.ListenerException
protected IMessageBrowser<M> augmentMessageBrowser(IMessageBrowser<M> browser)
public IMessageBrowser<M> getMessageBrowser(ProcessState state)
IProvidesMessageBrowsers
browser
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).getMessageBrowser
in interface IProvidesMessageBrowsers<M>
getMessageBrowser
in class JdbcTableListener<M>
public String getSelectCondition()
public void setSlotId(String slotId)
public void setSessionKeys(String sessionKeys)
MessageStoreSender
must have the same value for this attribute@Default(value="IBISSTORE") @Optional public void setTableName(String string)
JdbcTableListener
setTableName
in class JdbcTableListener<M>
@Default(value="MESSAGEKEY") public void setKeyField(String fieldname)
JdbcListener
setKeyField
in class JdbcListener<M>
@Default(value="MESSAGE") public void setMessageField(String fieldname)
JdbcListener
setMessageField
in class JdbcListener<M>
@Default(value="MESSAGEID") public void setMessageIdField(String fieldname)
JdbcListener
setMessageIdField
in class JdbcListener<M>
@Default(value="CORRELATIONID") public void setCorrelationIdField(String fieldname)
JdbcListener
setCorrelationIdField
in class JdbcListener<M>
@Default(value="BLOB") public void setMessageFieldType(JdbcListener.MessageFieldType fieldtype)
JdbcListener
setMessageFieldType
in class JdbcListener<M>
@Default(value="<code>true</code>") public void setBlobSmartGet(boolean b)
JdbcListener
setBlobSmartGet
in class JdbcListener<M>
@Default(value="TYPE") @Optional public void setStatusField(String fieldname)
JdbcTableListener
setStatusField
in class JdbcTableListener<M>
@Default(value="MESSAGEDATE") public void setTimestampField(String fieldname)
JdbcTableListener
setTimestampField
in class JdbcTableListener<M>
@Default(value="COMMENTS") public void setCommentField(String commentField)
JdbcTableListener
setCommentField
in class JdbcTableListener<M>
public void setStatusValueAvailable(String string)
setStatusValueAvailable
in class JdbcTableListener<M>
M
public void setStatusValueInProcess(String string)
I
if database has no SKIP LOCKED functionality, the Receiver cannot be set to Required
or RequiresNew
, or to support programmatic retry.setStatusValueInProcess
in class JdbcTableListener<M>
@Default(value="<code>E</code>") @Optional public void setStatusValueError(String string)
JdbcTableListener
setStatusValueError
in class JdbcTableListener<M>
@Default(value="<code>A</code>") @Optional public void setStatusValueProcessed(String string)
JdbcTableListener
setStatusValueProcessed
in class JdbcTableListener<M>
public void setStatusValueHold(String string)
H
.setStatusValueHold
in class JdbcTableListener<M>
public void setMoveToMessageLog(boolean moveToMessageLog)
false
, messages are deleted after being processedtrue
Copyright © 2023 Frank!Framework. All rights reserved.