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:
FrankElement,HasApplicationContext,HasName,HasPhysicalDestination,IConfigurable,IMessageBrowser<S>,IScopeProvider,ITransactionalStorage<S>,IXAEnabled,NameAware,ConfigurableLifecycle,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
- Direct Known Subclasses:
EsbJmsTransactionalStorage
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.JmsDestinationType, JMSFacade.MessageClass, JMSFacade.SubscriberTypeNested classes/interfaces inherited from interface org.frankframework.core.IMessageBrowser
IMessageBrowser.HideMethod, IMessageBrowser.SortOrder, IMessageBrowser.StorageType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.frankframework.jms.JMSFacade
JMS_MESSAGECLASS_KEY, log, messagingSourceFields inherited from interface org.frankframework.core.ITransactionalStorage
MAXCOMMENTLENFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbrowseMessage(String storageKey) Retrieves the message, but does not delete.consumeMessage(String storageKey) Retrieves and deletes the message.booleancontainsMessageId(String originalMessageId) Check if the storage contains message with the given original messageId (as passed to storeMessage).getType()voidOptional identifier for this storage, to be able to share the physical storage between a number of receivers and pipes.voidPossible values areE(error store),M(message store),L(message log for Pipe) orA(message log for Receiver).
Receiver will always set type toEfor errorStorage and always set type toAfor 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, getIterator, getIterator, getJmsMessage, getMessageCount, getStorageFields, setTimeoutMethods inherited from class org.frankframework.jms.JMSFacade
checkTransactionManagerValidity, closeSession, configure, createBytesMessage, createMessage, createMessage, createSession, createTextMessage, extractMessage, extractMessageBody, getConnectionFactoryName, getContext, getDestination, getDestination, getJmsMessagingSource, getLogPrefix, getMessageConsumer, getMessageConsumer, getMessageConsumerForCorrelationId, getMessageProducer, getMessagingSource, getPhysicalDestinationName, getPhysicalDestinationShortName, getPhysicalDestinationShortName, isRunning, isSessionsArePooled, logMessageDetails, send, send, send, send, send, sendByQueue, sendByTopic, setAcknowledgeMode, setAuthAlias, setCorrelationIdMaxLength, setCorrelationIdToHex, setCorrelationIdToHexPrefix, setDestinationName, setDestinationType, setJndiContextPrefix, setLookupDestination, setMessageClass, setMessageCorrelationID, setMessageSelector, setMessageTimeToLive, setName, setPersistent, setQueueConnectionFactoryName, setSubscriberType, setTopicConnectionFactoryName, setTransacted, start, stop, toStringMethods inherited from class org.frankframework.jndi.JndiBase
getContext, getJndiEnv, setAuthentication, setCredentials, setInitialContextFactoryName, setJmsRealm, setJndiAuthAlias, setJndiProperties, setPrincipal, setProviderURL, setSecurityProtocol, setUrlPkgPrefixesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface org.frankframework.lifecycle.ConfigurableLifecycle
getPhase, isAutoStartup, isConfiguredMethods inherited from interface org.frankframework.core.FrankElement
addConfigWarningMethods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoaderMethods inherited from interface org.frankframework.core.IMessageBrowser
containsCorrelationId, deleteMessage, getContext, getHideMethod, getHideRegex, getIterator, getIterator, getMessageCount, getStorageFields, setHideMethod, setHideRegexMethods inherited from interface org.frankframework.core.ITransactionalStorage
configure, start, stopMethods inherited from interface org.frankframework.core.IXAEnabled
isTransactedMethods inherited from interface org.springframework.context.SmartLifecycle
stop
-
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:ITransactionalStorageStore the message, returns storageKey. The messageId should be unique.- Specified by:
storeMessagein interfaceITransactionalStorage<S extends Serializable>- Throws:
SenderException
-
containsMessageId
Description copied from interface:IMessageBrowserCheck if the storage contains message with the given original messageId (as passed to storeMessage).- Specified by:
containsMessageIdin interfaceIMessageBrowser<S extends Serializable>- Overrides:
containsMessageIdin classAbstractJmsMessageBrowser<S extends Serializable,jakarta.jms.ObjectMessage> - Throws:
ListenerException
-
browseMessage
Description copied from interface:IMessageBrowserRetrieves the message, but does not delete.- Specified by:
browseMessagein interfaceIMessageBrowser<S extends Serializable>- Throws:
ListenerException
-
consumeMessage
Description copied from interface:ITransactionalStorageRetrieves and deletes the message.- Specified by:
consumeMessagein interfaceITransactionalStorage<S extends Serializable>- Throws:
ListenerException
-
getSelector
-
setSlotId
Description copied from interface:ITransactionalStorageOptional identifier for this storage, to be able to share the physical storage between a number of receivers and pipes.- Specified by:
setSlotIdin interfaceITransactionalStorage<S extends Serializable>
-
getSlotId
- Specified by:
getSlotIdin interfaceITransactionalStorage<S extends Serializable>
-
setType
Description copied from interface:ITransactionalStoragePossible values areE(error store),M(message store),L(message log for Pipe) orA(message log for Receiver).
Receiver will always set type toEfor errorStorage and always set type toAfor messageLog. SenderPipe will set type toLfor messageLog (when type isn't specified).
SeeMessageStoreSenderfor typeM.- Specified by:
setTypein interfaceITransactionalStorage<S extends Serializable>
-
getType
- Specified by:
getTypein interfaceITransactionalStorage<S extends Serializable>
-