@FrankDocGroup(name="Senders") public class MessageStoreSender extends JdbcTransactionalStorage<String> implements ISenderWithParameters
MessageStoreListener
.
This other adapter will process the messages asynchronously and (optionally)
under transaction control. Duplicate messages are ignored based on the
messageId (except when onlyStoreWhenMessageIdUnique is set to false), hence
the sender of the message can retry sending the message until a valid reply
is received in which case it can be certain that the message is stored in the
ibisstore.
Example configuration:
<sender
className="nl.nn.adapterframework.jdbc.MessageStoreSender"
datasourceName="${jdbc.datasource.default}"
slotId="${instance.name}/ServiceName"
sessionKeys="key1,key2"
>
<param name="messageId" xpathExpression="/Envelope/Header/MessageID"/>
</sender>
IMessageBrowser.HideMethod, IMessageBrowser.SortOrder, IMessageBrowser.StorageType
HasStatistics.Action
Modifier and Type | Field and Description |
---|---|
static String |
PARAM_MESSAGEID |
insertQuery, MAXCIDLEN, MAXIDLEN, MAXLABELLEN, selectDataQuery2, selectKeyQuery, txManager, updateBlobQuery
useIndexHint
checkCorrelationIdQuery, checkMessageIdQuery, CONTROL_PROPERTY_PREFIX, deleteQuery, getMessageCountQuery, PROPERTY_ASSUME_PRIMARY_KEY_UNIQUE, PROPERTY_USE_PARAMETERS, selectContextQuery, selectDataQuery, selectKeyQueryIsDbmsSupported
MAXCOMMENTLEN
Constructor and Description |
---|
MessageStoreSender() |
Modifier and Type | Method and Description |
---|---|
void |
addParameter(Parameter p) |
void |
configure()
configure() is called once at startup of the framework in the configure method of the owner of this sender. |
ParameterList |
getParameterList() |
boolean |
isSynchronous()
When
true , the result of sendMessage is the reply of the request. |
SenderResult |
sendMessage(Message message,
PipeLineSession session)
Send a message to some destination (as configured in the Sender object).
|
void |
setOnlyStoreWhenMessageIdUnique(boolean onlyStoreWhenMessageIdUnique)
If set to
true , the message is stored only if the MessageId is not present in the store yet. |
void |
setSessionKeys(String sessionKeys)
Comma separated list of sessionKey's to be stored together with the message.
|
createQueryTexts, createStorage, getLogPrefix, getMessage, getStorageRefKey, initialize, open, retrieveObject, setBlobsCompressed, setCheckIfTableExists, setCheckTable, setCreateTable, setDataTypes, setDateFieldType, setHostField, setKeyFieldType, setMessageFieldType, setOperationControls, setRetention, setSchemaOwner4Check, setSequenceName, setSlotId, setSlotIdField, setStoreFullMessage, setTextFieldType, setType, setTypeField, storeMessage, storeMessage, storeMessageInDatabase
createSelector, getFromClause, getPhysicalDestinationName, getSelectListQuery, provideFirstRowsHintAfterFirstKeyword, provideIndexHintAfterFirstKeyword, provideTrailingFirstRowsHint, setIndexName, setTableName
applyStandardParameters, applyStandardParameters, browseMessage, containsCorrelationId, containsMessageId, copyFacadeSettings, deleteMessage, getContext, getDatasource, getIterator, getIterator, getMessageCount, getWhereClause, setCommentField, setCorrelationIdField, setDateField, setExpiryDateField, setIdField, setKeyField, setLabelField, setMessageField, setOrder, setPrefix
getAuthAlias, getConnection, getConnectionWithTimeout, getDatasourceInfo, getDatasourceName, getDbmsSupport, getPassword, getUsername, isConnectionsArePooled, isTransacted, iterateOverStatistics, setAuthAlias, setConnectionsArePooled, setDatasourceName, setDbmsSupportFactory, setJmsRealm, setPassword, setTransacted, setUsername
close, getContext, getJndiEnv, setAuthentication, setCredentials, setInitialContextFactoryName, setJndiAuthAlias, setJndiContextPrefix, setJndiProperties, setName, setPrincipal, setProviderURL, setSecurityProtocol, setUrlPkgPrefixes, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
consumesSessionVariable
close, open, sendMessageOrThrow
getName, setName
getApplicationContext, getName
getConfigurationClassLoader
setApplicationContext
close, getSlotId, getType
browseMessage, containsCorrelationId, containsMessageId, deleteMessage, getContext, getHideMethod, getHideRegex, getIterator, getIterator, getMessageCount, setHideMethod, setHideRegex
isTransacted
getDomain
public static final String PARAM_MESSAGEID
public void configure() throws ConfigurationException
ISender
configure()
is called once at startup of the framework in the configure method of the owner of this sender.
Purpose of this method is to check whether the static configuration of the sender is correct.
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 ISender
configure
in interface ITransactionalStorage<String>
configure
in class JdbcTransactionalStorage<String>
ConfigurationException
public boolean isSynchronous()
ISender
true
, the result of sendMessage is the reply of the request.isSynchronous
in interface ISender
public void addParameter(Parameter p)
addParameter
in interface IWithParameters
public ParameterList getParameterList()
getParameterList
in interface IWithParameters
public SenderResult sendMessage(Message message, PipeLineSession session) throws SenderException, TimeoutException
ISender
configure()
method is called.
The following table shows the difference between synchronous and a-synchronous senders:
synchronous | a-synchronous | |
---|---|---|
ISender.isSynchronous() returns | true | false |
return value of sendMessage() is | the reply-message | the messageId of the message sent |
the correlationID specified with sendMessage() | may be ignored | is sent with the message |
a {link TimeOutException} | may be thrown if a timeout occurs waiting for a reply | should not be expected |
Multiple objects may try to call this method at the same time, from different threads.
Implementations of this method should therefore be thread-safe, or synchronized
.
sendMessage
in interface ISender
SenderException
TimeoutException
public void setSessionKeys(String sessionKeys)
MessageStoreListener
must have the same value for this attribute.public void setOnlyStoreWhenMessageIdUnique(boolean onlyStoreWhenMessageIdUnique)
true
, the message is stored only if the MessageId is not present in the store yet.setOnlyStoreWhenMessageIdUnique
in class JdbcTransactionalStorage<String>
true
Copyright © 2023 Frank!Framework. All rights reserved.