Package org.frankframework.jms
Class JmsTransactionalStorage<S extends Serializable>
java.lang.Object
org.frankframework.jndi.JndiBase
org.frankframework.jms.JMSFacade
org.frankframework.jms.AbstractJmsMessageBrowser<S,jakarta.jms.ObjectMessage>
org.frankframework.jms.JmsTransactionalStorage<S>
- All Implemented Interfaces:
HasPhysicalDestination
,IConfigurable
,IConfigurationAware
,IMessageBrowser<S>
,INamedObject
,IScopeProvider
,ITransactionalStorage<S>
,IXAEnabled
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class JmsTransactionalStorage<S extends Serializable>
extends AbstractJmsMessageBrowser<S,jakarta.jms.ObjectMessage>
implements ITransactionalStorage<S>
Implements a message log (
Message log: A message log writes messages in persistent storage for logging purposes. When a message log appears in a receiver, it also ensures that the same message is only processed once, even if a related pushing listener receives the same message multiple times.
Error store: Appears in a receiver or sender pipe to store messages that could not be processed. Storing a message in the error store is the last resort of the Frank!Framework. Many types of listeners and senders offer a retry mechanism. Only if several tries have failed, then an optional transaction is not rolled back and the message is stored in the error store. Users can retry messages in an error store using the Frank!Console. When this is done, the message is processed in the same way as messages received from the original source.
How does a message log or error store see duplicate messages? The message log or error store always appears in combination with a sender or listener. This sender or listener determines a key based on the sent or received message. Messages with the same key are considered to be the same.
JmsMessageLog
) or error store (JmsErrorStorage
) that uses JMS technology.
Message log: A message log writes messages in persistent storage for logging purposes. When a message log appears in a receiver, it also ensures that the same message is only processed once, even if a related pushing listener receives the same message multiple times.
Error store: Appears in a receiver or sender pipe to store messages that could not be processed. Storing a message in the error store is the last resort of the Frank!Framework. Many types of listeners and senders offer a retry mechanism. Only if several tries have failed, then an optional transaction is not rolled back and the message is stored in the error store. Users can retry messages in an error store using the Frank!Console. When this is done, the message is processed in the same way as messages received from the original source.
How does a message log or error store see duplicate messages? The message log or error store always appears in combination with a sender or listener. This sender or listener determines a key based on the sent or received message. Messages with the same key are considered to be the same.
- Since:
- 4.1
- Author:
- Gerrit van Brakel
-
Nested Class Summary
Nested classes/interfaces inherited from class org.frankframework.jms.JMSFacade
JMSFacade.AcknowledgeMode, JMSFacade.DeliveryMode, JMSFacade.DestinationType, JMSFacade.MessageClass, JMSFacade.SubscriberType
Nested classes/interfaces inherited from interface org.frankframework.core.IMessageBrowser
IMessageBrowser.HideMethod, IMessageBrowser.SortOrder, IMessageBrowser.StorageType
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class org.frankframework.jms.JMSFacade
JMS_MESSAGECLASS_KEY, messagingSource
Fields inherited from interface org.frankframework.core.ITransactionalStorage
MAXCOMMENTLEN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbrowseMessage
(String storageKey) Retrieves the message, but does not delete.boolean
containsMessageId
(String originalMessageId) Check if the storage contains message with the given original messageId (as passed to storeMessage).getMessage
(String storageKey) Retrieves and deletes the message.getType()
void
Optional identifier for this storage, to be able to share the physical storage between a number of receivers and pipes.void
Possible values areE
(error store),M
(message store),L
(message log for Pipe) orA
(message log for Receiver).
Receiver will always set type toE
for errorStorage and always set type toA
for messageLog.storeMessage
(String messageId, String correlationId, Date receivedDate, String comments, String label, S message) Store the message, returns storageKey.Methods inherited from class org.frankframework.jms.AbstractJmsMessageBrowser
browseJmsMessage, containsCorrelationId, deleteMessage, doBrowse, doBrowse, getCombinedSelector, getCombinedSelector, getContext, getHideMethod, getHideRegex, getIterator, getIterator, getJmsMessage, getMessageCount, getTimeout, setHideMethod, setHideRegex, setTimeout, setTimeOut
Methods inherited from class org.frankframework.jms.JMSFacade
checkTransactionManagerValidity, closeSession, configure, createBytesMessage, createMessage, createMessage, createSession, createTextMessage, extractMessage, extractMessageBody, getAcknowledgeMode, getAuthAlias, getConnectionFactoryFactory, getConnectionFactoryInfo, getConnectionFactoryName, getContext, getCorrelationIdMaxLength, getCorrelationIdToHexPrefix, getDestination, getDestination, getDestinationName, getDestinationType, getDomain, getJmsMessagingSource, getLogPrefix, getMessageClass, getMessageConsumer, getMessageConsumer, getMessageConsumerForCorrelationId, getMessageProducer, getMessageSelector, getMessageTimeToLive, getMessagingSource, getMessagingSourceFactory, getPhysicalDestinationName, getPhysicalDestinationShortName, getPhysicalDestinationShortName, getProxiedDestinationNames, getQueueConnectionFactoryName, getSubscriberType, getTopicConnectionFactoryName, getTxManager, isCorrelationIdToHex, isJmsTransacted, isLookupDestination, isPersistent, isSessionsArePooled, isTransacted, isUseTopicFunctions, logMessageDetails, send, send, send, send, send, send, send, sendByQueue, sendByTopic, setAcknowledgeMode, setAuthAlias, setConnectionFactoryFactory, setCorrelationIdMaxLength, setCorrelationIdToHex, setCorrelationIdToHexPrefix, setDestinationName, setDestinationType, setJmsTransacted, setLookupDestination, setMessageClass, setMessageCorrelationID, setMessageSelector, setMessageTimeToLive, setPersistent, setProxiedDestinationNames, setQueueConnectionFactoryName, setSubscriberType, setTopicConnectionFactoryName, setTransacted, setTxManager, start, stop, toString
Methods inherited from class org.frankframework.jndi.JndiBase
getApplicationContext, getAuthentication, getConfigurationClassLoader, getContext, getCredentials, getInitialContextFactoryName, getJmsRealmName, getJndiAuthAlias, getJndiContextPrefix, getJndiEnv, getJndiProperties, getName, getPrincipal, getProviderURL, getSecurityProtocol, getUrlPkgPrefixes, setApplicationContext, setAuthentication, setCredentials, setInitialContextFactoryName, setJmsRealm, setJndiAuthAlias, setJndiContextPrefix, setJndiProperties, setName, setPrincipal, setProviderURL, setSecurityProtocol, setUrlPkgPrefixes
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.frankframework.core.IMessageBrowser
containsCorrelationId, deleteMessage, getContext, getHideMethod, getHideRegex, getIterator, getIterator, getMessageCount, setHideMethod, setHideRegex
Methods inherited from interface org.frankframework.core.INamedObject
getName, setName
Methods inherited from interface org.frankframework.core.ITransactionalStorage
configure, start, stop
Methods inherited from interface org.frankframework.core.IXAEnabled
isTransacted
-
Field Details
-
FIELD_TYPE
- See Also:
-
FIELD_ORIGINAL_ID
- See Also:
-
FIELD_RECEIVED_DATE
- See Also:
-
FIELD_COMMENTS
- See Also:
-
FIELD_SLOTID
- See Also:
-
FIELD_HOST
- See Also:
-
FIELD_LABEL
- See Also:
-
-
Constructor Details
-
JmsTransactionalStorage
public JmsTransactionalStorage()
-
-
Method Details
-
storeMessage
public String storeMessage(String messageId, String correlationId, Date receivedDate, String comments, String label, S message) throws SenderException Description copied from interface:ITransactionalStorage
Store the message, returns storageKey. The messageId should be unique.- Specified by:
storeMessage
in interfaceITransactionalStorage<S extends Serializable>
- Throws:
SenderException
-
containsMessageId
Description copied from interface:IMessageBrowser
Check if the storage contains message with the given original messageId (as passed to storeMessage).- Specified by:
containsMessageId
in interfaceIMessageBrowser<S extends Serializable>
- Overrides:
containsMessageId
in classAbstractJmsMessageBrowser<S extends Serializable,
jakarta.jms.ObjectMessage> - Throws:
ListenerException
-
browseMessage
Description copied from interface:IMessageBrowser
Retrieves the message, but does not delete.- Specified by:
browseMessage
in interfaceIMessageBrowser<S extends Serializable>
- Throws:
ListenerException
-
getMessage
Description copied from interface:ITransactionalStorage
Retrieves and deletes the message.- Specified by:
getMessage
in interfaceITransactionalStorage<S extends Serializable>
- Throws:
ListenerException
-
getSelector
- Overrides:
getSelector
in classAbstractJmsMessageBrowser<S extends Serializable,
jakarta.jms.ObjectMessage>
-
setSlotId
Description copied from interface:ITransactionalStorage
Optional identifier for this storage, to be able to share the physical storage between a number of receivers and pipes.- Specified by:
setSlotId
in interfaceITransactionalStorage<S extends Serializable>
-
getSlotId
- Specified by:
getSlotId
in interfaceITransactionalStorage<S extends Serializable>
-
setType
Description copied from interface:ITransactionalStorage
Possible values areE
(error store),M
(message store),L
(message log for Pipe) orA
(message log for Receiver).
Receiver will always set type toE
for errorStorage and always set type toA
for messageLog. SenderPipe will set type toL
for messageLog (when type isn't specified).
SeeMessageStoreSender
for typeM
.- Specified by:
setType
in interfaceITransactionalStorage<S extends Serializable>
-
getType
- Specified by:
getType
in interfaceITransactionalStorage<S extends Serializable>
-