public class JdbcTransactionalStorage<S extends Serializable> extends JdbcTableMessageBrowser<S> implements ITransactionalStorage<S>
JdbcMessageLog
) or error store (JdbcErrorStorage
) that uses database
table IBISSTORE. A MessageStoreSender
and MessageStoreListener
pair implicitly includes a message log and an error store.
If you have a MessageStoreSender
and MessageStoreListener
pair it is superfluous to add a JdbcMessageLog
or JdbcErrorStorage
within the same sender pipe or the same receiver.
The error code was XAER_RMERR. The exception stack trace follows: javax.transaction.xa.XAException at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:508)
IMessageBrowser.HideMethod, IMessageBrowser.SortOrder, IMessageBrowser.StorageType
HasStatistics.Action
Modifier and Type | Field and Description |
---|---|
protected String |
insertQuery |
protected static int |
MAXCIDLEN |
protected static int |
MAXIDLEN |
protected static int |
MAXLABELLEN |
protected String |
selectDataQuery2 |
protected String |
selectKeyQuery |
protected org.springframework.transaction.PlatformTransactionManager |
txManager |
protected String |
updateBlobQuery |
useIndexHint
checkCorrelationIdQuery, checkMessageIdQuery, CONTROL_PROPERTY_PREFIX, deleteQuery, getMessageCountQuery, PROPERTY_ASSUME_PRIMARY_KEY_UNIQUE, PROPERTY_USE_PARAMETERS, selectContextQuery, selectDataQuery, selectKeyQueryIsDbmsSupported
MAXCOMMENTLEN
Constructor and Description |
---|
JdbcTransactionalStorage() |
Modifier and Type | Method and Description |
---|---|
void |
configure()
Creates a connection, checks if the table is existing and creates it when necessary
|
protected void |
createQueryTexts(IDbmsSupport dbmsSupport) |
protected void |
createStorage(Connection conn,
Statement stmt,
IDbmsSupport dbmsSupport)
Acutaly creates storage.
|
protected String |
getLogPrefix() |
RawMessageWrapper<S> |
getMessage(String storageKey)
Retrieves and deletes the message.
|
protected String |
getStorageRefKey() |
void |
initialize(IDbmsSupport dbmsSupport)
Checks if table exists, and creates when necessary.
|
void |
open()
Prepares the object for operation.
|
protected RawMessageWrapper<S> |
retrieveObject(String storageKey,
ResultSet rs,
int columnIndex) |
void |
setBlobsCompressed(boolean b)
If set to
true , the messages are stored compressed |
void |
setCheckIfTableExists(boolean b)
Deprecated.
|
void |
setCheckTable(boolean b)
If set to
true , checks are performed if the table exists and is properly created |
void |
setCreateTable(boolean b)
Deprecated.
|
protected void |
setDataTypes(IDbmsSupport dbmsSupport)
change datatypes used for specific database vendor.
|
void |
setDateFieldType(String string)
The type of the column the timestamps are stored in
|
void |
setHostField(String hostField) |
void |
setKeyFieldType(String string)
The type of the column that contains the primary key of the table
|
void |
setMessageFieldType(String string)
The type of the column message themselves are stored in
|
void |
setOnlyStoreWhenMessageIdUnique(boolean onlyStoreWhenMessageIdUnique)
If set to
true , the message is stored only if the MessageId is not present in the store yet. |
protected void |
setOperationControls() |
void |
setRetention(int retention)
The time (in days) to keep the record in the database before making it eligible for deletion by a cleanup process.
|
void |
setSchemaOwner4Check(String string)
Schema owner to be used to check the database
|
void |
setSequenceName(String string)
The name of the sequence used to generate the primary key, for DBMSes that use sequences, like Oracle
|
void |
setSlotId(String string)
Optional identifier for this storage, to be able to share the physical storage between a number of receivers and pipes.
|
void |
setSlotIdField(String string) |
void |
setStoreFullMessage(boolean storeFullMessage)
If set to
true , the full message is stored with the log. |
void |
setTextFieldType(String string)
The type of the columns messageId and correlationId, slotId and comments are stored in.
|
void |
setType(String type)
Possible values are
E (error store), M (message store), L (message log for Pipe) or A (message log for Receiver).Receiver will always set type to E for errorStorage and always set type to A for messageLog. |
void |
setTypeField(String typeField) |
String |
storeMessage(Connection conn,
String messageId,
String correlationId,
Date receivedDate,
String comments,
String label,
S message)
Stores a message in the database and retrieves the value of the primary key for the record just inserted.
|
String |
storeMessage(String messageId,
String correlationId,
Date receivedDate,
String comments,
String label,
S message)
Store the message, returns storageKey.
|
protected String |
storeMessageInDatabase(Connection conn,
String messageId,
String correlationId,
Timestamp receivedDateTime,
String comments,
String label,
S message) |
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
close, getSlotId, getType
browseMessage, containsCorrelationId, containsMessageId, deleteMessage, getContext, getHideMethod, getHideRegex, getIterator, getIterator, getMessageCount, setHideMethod, setHideRegex
isTransacted
getName, setName
getDomain
getApplicationContext, getName
getConfigurationClassLoader
protected static final int MAXIDLEN
protected static final int MAXCIDLEN
protected static final int MAXLABELLEN
protected String insertQuery
protected String selectKeyQuery
protected String selectDataQuery2
protected String updateBlobQuery
protected org.springframework.transaction.PlatformTransactionManager txManager
protected String getLogPrefix()
getLogPrefix
in class JdbcTableMessageBrowser<S extends Serializable>
protected void setOperationControls()
setOperationControls
in class JdbcTableMessageBrowser<S extends Serializable>
public void configure() throws ConfigurationException
configure
in interface IConfigurable
configure
in interface ITransactionalStorage<S extends Serializable>
configure
in class JdbcTableMessageBrowser<S extends Serializable>
ConfigurationException
public void open() throws SenderException
ITransactionalStorage
open
in interface ITransactionalStorage<S extends Serializable>
SenderException
protected void setDataTypes(IDbmsSupport dbmsSupport)
protected void createQueryTexts(IDbmsSupport dbmsSupport) throws ConfigurationException
createQueryTexts
in class JdbcTableMessageBrowser<S extends Serializable>
ConfigurationException
public void initialize(IDbmsSupport dbmsSupport) throws JdbcException, SQLException, SenderException
JdbcException
SQLException
SenderException
protected void createStorage(Connection conn, Statement stmt, IDbmsSupport dbmsSupport) throws JdbcException
JdbcException
protected String storeMessageInDatabase(Connection conn, String messageId, String correlationId, Timestamp receivedDateTime, String comments, String label, S message) throws IOException, SQLException, JdbcException, SenderException
public String storeMessage(String messageId, String correlationId, Date receivedDate, String comments, String label, S message) throws SenderException
ITransactionalStorage
storeMessage
in interface ITransactionalStorage<S extends Serializable>
SenderException
public String storeMessage(@Nonnull Connection conn, @Nonnull String messageId, @Nonnull String correlationId, @Nonnull Date receivedDate, @Nullable String comments, @Nullable String label, @Nonnull S message) throws SenderException
conn
- the database connectionmessageId
- the ID of the messagecorrelationId
- the correlation ID of the messagereceivedDate
- the date when the message was receivedcomments
- additional comments for the message (optional)label
- the label for the message (optional)message
- the message object to be storedSenderException
- if there is an error storing the messageprotected RawMessageWrapper<S> retrieveObject(String storageKey, ResultSet rs, int columnIndex) throws JdbcException
retrieveObject
in class JdbcTableMessageBrowser<S extends Serializable>
JdbcException
public RawMessageWrapper<S> getMessage(String storageKey) throws ListenerException
ITransactionalStorage
getMessage
in interface ITransactionalStorage<S extends Serializable>
ListenerException
protected String getStorageRefKey()
public void setSlotId(String string)
ITransactionalStorage
setSlotId
in interface ITransactionalStorage<S extends Serializable>
setSlotId
in class JdbcMessageBrowser<S extends Serializable>
public void setType(String type)
ITransactionalStorage
E
(error store), M
(message store), L
(message log for Pipe) or A
(message log for Receiver).E
for errorStorage and always set type to A
for messageLog. SenderPipe will set type to L
for messageLog (when type isn't specified).MessageStoreSender
for type M
.setType
in interface ITransactionalStorage<S extends Serializable>
setType
in class JdbcMessageBrowser<S extends Serializable>
public void setSlotIdField(String string)
setSlotIdField
in class JdbcMessageBrowser<S extends Serializable>
public void setTypeField(String typeField)
setTypeField
in class JdbcMessageBrowser<S extends Serializable>
public void setHostField(String hostField)
setHostField
in class JdbcMessageBrowser<S extends Serializable>
public void setSequenceName(String string)
@Deprecated @ConfigurationWarning(value="Replaced with checkTable") public void setCheckIfTableExists(boolean b)
public void setCheckTable(boolean b)
true
, checks are performed if the table exists and is properly created@Deprecated @ConfigurationWarning(value="if you want to create and maintain database tables, please enable Liquibase") public void setCreateTable(boolean b)
true
, the table is created if it does not existpublic void setMessageFieldType(String string)
public void setKeyFieldType(String string)
public void setDateFieldType(String string)
public void setTextFieldType(String string)
(100)
is appended for id's, (1000)
is appended for comments.public void setBlobsCompressed(boolean b)
true
, the messages are stored compressedpublic void setRetention(int retention)
public void setSchemaOwner4Check(String string)
public void setStoreFullMessage(boolean storeFullMessage)
true
, the full message is stored with the log. Can be set to false
to reduce table size, by avoiding to store the full messagepublic void setOnlyStoreWhenMessageIdUnique(boolean onlyStoreWhenMessageIdUnique)
true
, the message is stored only if the MessageId is not present in the store yet.Copyright © 2023 Frank!Framework. All rights reserved.