public class MessageStoreListener<M> extends JdbcTableListener<M>
MessageStoreSender
.
Example configuration:
<listener
name="MyListener"
className="nl.nn.adapterframework.jdbc.MessageStoreListener"
datasourceName="${jdbc.datasource.default}"
slotId="${instance.name}/ServiceName"
sessionKeys="key1,key2"
/>
<!-- On error the message is moved to the errorStorage. And when moveToMessageLog="true" also to the messageLog (after manual resend the messageLog doesn't change). -->
<errorStorage
className="nl.nn.adapterframework.jdbc.JdbcTransactionalStorage"
datasourceName="${jdbc.datasource.default}"
slotId="${instance.name}/ServiceName"
/>
JdbcListener.MessageFieldType
HasStatistics.Action
connection, CORRELATION_ID_KEY, STORAGE_KEY_KEY
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. |
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). |
M |
getRawMessage(Map<String,Object> threadContext)
Retrieves messages from queue or other channel, but does no processing on it.
|
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, extractMessage, extractRawMessage, getIdFromRawMessage, getKeyFromRawMessage, 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 M getRawMessage(Map<String,Object> threadContext) throws ListenerException
IPullingListener
synchronized
.
Any thread-specific properties should be stored in and retrieved from the threadContext.
getRawMessage
in interface IPullingListener<M>
getRawMessage
in class JdbcListener<M>
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.