Class PushingJmsListener
- All Implemented Interfaces:
FrankElement,HasApplicationContext,HasName,HasPhysicalDestination,HasSender,IConfigurable,IKnowsDeliveryCount<jakarta.jms.Message>,IListener<jakarta.jms.Message>,IPortConnectedListener<jakarta.jms.Message>,IPushingListener<jakarta.jms.Message>,IRedeliveringListener<jakarta.jms.Message>,IScopeProvider,IThreadCountControllable,IWithParameters,IXAEnabled,NameAware,ConfigurableLifecycle,ReceiverAware<jakarta.jms.Message>,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
- Direct Known Subclasses:
JmsListener
JmsListener supports distributed transactions using the XA-protocol.
No special action is required to have the listener join the transaction.
Setting listener.acknowledgeMode to "auto" means that messages are allways acknowledged (removed from
the queue, regardless of what the status of the Adapter is. "client" means that the message will only be removed from the queue
when the state of the Adapter equals the success state.
The "dups" mode instructs the session to lazily acknowledge the delivery of the messages. This is likely to result in the
delivery of duplicate messages if JMS fails. It should be used by consumers who are tolerant in processing duplicate messages.
In cases where the client is tolerant of duplicate messages, some enhancement in performance can be achieved using this mode,
since a session has lower overhead in trying to prevent duplicate messages.
The setting for listener.acknowledgeMode will only be processed if
the setting for listener.transacted.
If useReplyTo is set and a replyTo-destination is
specified in the message, the JmsListener sends the result of the processing
in the pipeline to this destination. Otherwise the result is sent using the (optionally)
specified Sender, that in turn sends the message to
whatever it is configured to.
Notice: the JmsListener is ONLY capable of processing
TextMessages and BytesMessage
- Since:
- 4.8
- Author:
- Tim van der Leeuw
-
Nested Class Summary
Nested classes/interfaces inherited from class org.frankframework.jms.JMSFacade
JMSFacade.AcknowledgeMode, JMSFacade.DeliveryMode, JMSFacade.JmsDestinationType, JMSFacade.MessageClass, JMSFacade.SubscriberType -
Field Summary
Fields inherited from class org.frankframework.jms.JMSFacade
JMS_MESSAGECLASS_KEY, log, messagingSourceFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConfigure this component.voidintintgetDeliveryCount(RawMessageWrapper<jakarta.jms.Message> rawMessage) intvoidbooleanbooleanvoidsetCacheMode(IListenerConnector.CacheMode cacheMode) voidsetDestinationName(String destinationName) Name of the JMS destination (queue or topic) to usevoidsetPollGuardInterval(long pollGuardInterval) Interval in milliseconds for the poll guard to check whether a successful poll was done by the (JMS Receive call) since last check.voidstart()Obtains a connection and a serviceQueue.voidstop()Releases references to serviceQueue and connection.RawMessageWrapper<jakarta.jms.Message> wrapRawMessage(jakarta.jms.Message rawMessage, PipeLineSession session) Wrap a raw message in a MessageWrapper.Methods inherited from class org.frankframework.jms.AbstractJmsListener
addParameter, afterMessageProcessed, extractMessage, extractMessageProperties, getMessageProperties, getParameterList, messageWillBeRedeliveredOnExitStateError, prepareReply, prepareReply, sendReply, setForceMessageIdAsCorrelationId, setReplyDeliveryMode, setReplyDestinationName, setReplyEncodingStyleURI, setReplyMessageTimeToLive, setReplyMessageType, setReplyNamespaceURI, setReplyPriority, setReplySoapAction, setSender, setSoap, setSoapHeaderSessionKey, setTimeout, setUseReplyToMethods inherited from class org.frankframework.jms.JMSFacade
checkTransactionManagerValidity, closeSession, 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, setDestinationType, setJndiContextPrefix, setLookupDestination, setMessageClass, setMessageCorrelationID, setMessageSelector, setMessageTimeToLive, setName, setPersistent, setQueueConnectionFactoryName, setSubscriberType, setTopicConnectionFactoryName, setTransacted, 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.IListener
afterMessageProcessed, extractMessageMethods inherited from interface org.frankframework.core.IPortConnectedListener
checkTransactionManagerValidity, getExceptionListener, getHandlerMethods inherited from interface org.frankframework.core.IPushingListener
setExceptionListener, setHandlerMethods inherited from interface org.frankframework.core.IXAEnabled
isTransactedMethods inherited from interface org.frankframework.receivers.ReceiverAware
getReceiver, setReceiverMethods inherited from interface org.springframework.context.SmartLifecycle
stop
-
Constructor Details
-
PushingJmsListener
public PushingJmsListener()
-
-
Method Details
-
configure
Description copied from interface:IConfigurableConfigure this component.configure()is called once at startup of the framework in the configure method of the owner of thisIConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in theconfigure(), to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configurein interfaceIConfigurable- Overrides:
configurein classAbstractJmsListener- Throws:
ConfigurationException- in case it was not able to configure the component.
-
start
public void start()Description copied from class:JMSFacadeObtains a connection and a serviceQueue.- Specified by:
startin interfaceConfigurableLifecycle- Specified by:
startin interfaceIListener<jakarta.jms.Message>- Specified by:
startin interfaceorg.springframework.context.Lifecycle- Overrides:
startin classAbstractJmsListener
-
stop
public void stop()Description copied from class:JMSFacadeReleases references to serviceQueue and connection.- Specified by:
stopin interfaceIListener<jakarta.jms.Message>- Specified by:
stopin interfaceorg.springframework.context.Lifecycle- Overrides:
stopin classAbstractJmsListener
-
wrapRawMessage
public RawMessageWrapper<jakarta.jms.Message> wrapRawMessage(jakarta.jms.Message rawMessage, PipeLineSession session) Description copied from interface:IPushingListenerWrap a raw message in a MessageWrapper. PopulatePipeLineSessionwith properties from the message.- Specified by:
wrapRawMessagein interfaceIPushingListener<jakarta.jms.Message>- Parameters:
rawMessage- The raw message data, unwrappedsession-PipeLineSessionto populate with properties from the message.- Returns:
- Wrapped raw message
-
isThreadCountReadable
public boolean isThreadCountReadable()- Specified by:
isThreadCountReadablein interfaceIThreadCountControllable
-
isThreadCountControllable
public boolean isThreadCountControllable()- Specified by:
isThreadCountControllablein interfaceIThreadCountControllable
-
getCurrentThreadCount
public int getCurrentThreadCount()- Specified by:
getCurrentThreadCountin interfaceIThreadCountControllable
-
getMaxThreadCount
public int getMaxThreadCount()- Specified by:
getMaxThreadCountin interfaceIThreadCountControllable
-
increaseThreadCount
public void increaseThreadCount()- Specified by:
increaseThreadCountin interfaceIThreadCountControllable
-
decreaseThreadCount
public void decreaseThreadCount()- Specified by:
decreaseThreadCountin interfaceIThreadCountControllable
-
getDeliveryCount
- Specified by:
getDeliveryCountin interfaceIKnowsDeliveryCount<jakarta.jms.Message>
-
setDestinationName
Description copied from class:JMSFacadeName of the JMS destination (queue or topic) to use- Overrides:
setDestinationNamein classJMSFacade
-
setCacheMode
-
setPollGuardInterval
public void setPollGuardInterval(long pollGuardInterval) Interval in milliseconds for the poll guard to check whether a successful poll was done by the (JMS Receive call) since last check. If polling has stopped this will be logged and the listener will be stopped and started in an attempt to workaround problems with polling. Polling might stop due to bugs in the JMS driver/implementation which should be fixed by the supplier. As the poll time includes reading and processing of the message no successful poll might be registered since the last check when message processing takes a long time, hence while messages are being processed the check on last successful poll will be skipped. Set to -1 to disable.- Default value
- ten times the specified timeout
-