public class PushingJmsListener extends JmsListenerBase implements IPortConnectedListener<javax.jms.Message>, IThreadCountControllable, IKnowsDeliveryCount<javax.jms.Message>
JmsListener
supports distributed transactions using the XA-protocol.
No special action is required to have the listener join the transaction.
Using jmsTransacted and acknowledgement
If jmsTransacted is set true
, it should ensure that a message is received and processed on
a both or nothing basis. IBIS will commit the the message, otherwise perform rollback. However, using
jmsTransacted, IBIS does not bring transactions within the adapters under transaction control,
compromising the idea of atomic transactions. In the roll-back situation messages sent to other
destinations within the Pipeline are NOT rolled back if jmsTransacted is set true
! In
the failure situation the message is therefore completely processed, and the roll back does not mean
that the processing is rolled back! To obtain the correct (transactional) behaviour, set
transacted
="true" for the enclosing Receiver. Do not use jmsTransacted for any new situation.
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
as well as for
listener.jmsTransacted
is false.
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
javax.jms.TextMessage
s
JMSFacade.AcknowledgeMode, JMSFacade.DeliveryMode, JMSFacade.DestinationType, JMSFacade.SubscriberType
messagingSource
Constructor and Description |
---|
PushingJmsListener() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Releases references to serviceQueue and connection.
|
void |
configure()
configure() is called once at startup of the framework in the configure() method
of the owner of this listener. |
void |
decreaseThreadCount() |
int |
getCurrentThreadCount() |
int |
getDeliveryCount(javax.jms.Message rawMessage) |
IListenerConnector<javax.jms.Message> |
getListenerPortConnector() |
int |
getMaxThreadCount() |
void |
increaseThreadCount() |
boolean |
isThreadCountControllable() |
boolean |
isThreadCountReadable() |
void |
open()
Obtains a connection and a serviceQueue.
|
void |
setCacheMode(IListenerConnector.CacheMode cacheMode) |
void |
setDestinationName(String destinationName)
Name of the JMS destination (queue or topic) to use
|
void |
setPollGuardInterval(long pollGuardInterval)
Interval in milliseconds for the poll guard to check whether a successful poll was done by the receive
(https://docs.oracle.com/javaee/7/api/javax/jms/messageconsumer.html#receive-long-) since last check.
|
addParameter, afterMessageProcessed, extractMessage, getIdFromRawMessage, getMessageProperties, getParameterList, messageWillBeRedeliveredOnExitStateError, prepareReply, prepareReply, retrieveIdFromMessage, sendReply, setForceMessageIdAsCorrelationId, setReplyDeliveryMode, setReplyDestinationName, setReplyEncodingStyleURI, setReplyMessageTimeToLive, setReplyMessageType, setReplyNamespaceURI, setReplyPriority, setReplySoapAction, setSender, setSoap, setSoapHeaderSessionKey, setTimeout, setTimeOut, setUseReplyTo
checkTransactionManagerValidity, closeSession, createMessage, createSession, extractMessage, extractMessageBody, getAcknowledgeModeEnum, getConnectionFactoryInfo, getConnectionFactoryName, getContext, getDestination, getDestination, getJmsMessagingSource, getLogPrefix, getManagedConnectionFactory, getMessageConsumer, getMessageConsumer, getMessageConsumerForCorrelationId, getMessageProducer, getMessagingSource, getMessagingSourceFactory, getPhysicalDestinationName, getPhysicalDestinationShortName, getPhysicalDestinationShortName, isSessionsArePooled, send, send, send, send, send, send, send, sendByQueue, sendByTopic, setAckMode, setAcknowledgeMode, setAuthAlias, setCorrelationIdMaxLength, setCorrelationIdToHex, setCorrelationIdToHexPrefix, setDestinationType, setJmsTransacted, setLookupDestination, setMessageCorrelationID, setMessageSelector, setMessageTimeToLive, setPersistent, setQueueConnectionFactoryName, setSubscriberType, setTopicConnectionFactoryName, setTransacted, toString, useJms102
getContext, getJndiEnv, setAuthentication, setCredentials, setInitialContextFactoryName, setJmsRealm, setJndiAuthAlias, setJndiContextPrefix, setJndiProperties, setName, setPrincipal, setProviderURL, setSecurityProtocol, setUrlPkgPrefixes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
checkTransactionManagerValidity, getExceptionListener, getHandler, getReceiver, setReceiver
setExceptionListener, setHandler
afterMessageProcessed, extractMessage, getIdFromRawMessage
getName, setName
getApplicationContext, getName
getConfigurationClassLoader
setApplicationContext
getDomain
isTransacted
public void configure() throws ConfigurationException
IListener
configure()
is called once at startup of the framework in the configure()
method
of the owner of this listener.
Purpose of this method is to reduce creating connections to databases etc. in the IPullingListener.getRawMessage(Map)
method.
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 IListener<javax.jms.Message>
configure
in class JmsListenerBase
ConfigurationException
public void open() throws ListenerException
JMSFacade
open
in interface IListener<javax.jms.Message>
open
in class JmsListenerBase
ListenerException
public void close()
JMSFacade
close
in interface IListener<javax.jms.Message>
close
in class JmsListenerBase
public IListenerConnector<javax.jms.Message> getListenerPortConnector()
getListenerPortConnector
in interface IPortConnectedListener<javax.jms.Message>
public boolean isThreadCountReadable()
isThreadCountReadable
in interface IThreadCountControllable
public boolean isThreadCountControllable()
isThreadCountControllable
in interface IThreadCountControllable
public int getCurrentThreadCount()
getCurrentThreadCount
in interface IThreadCountControllable
public int getMaxThreadCount()
getMaxThreadCount
in interface IThreadCountControllable
public void increaseThreadCount()
increaseThreadCount
in interface IThreadCountControllable
public void decreaseThreadCount()
decreaseThreadCount
in interface IThreadCountControllable
public int getDeliveryCount(javax.jms.Message rawMessage)
getDeliveryCount
in interface IKnowsDeliveryCount<javax.jms.Message>
@Mandatory public void setDestinationName(String destinationName)
JMSFacade
setDestinationName
in class JMSFacade
public void setCacheMode(IListenerConnector.CacheMode cacheMode)
public void setPollGuardInterval(long pollGuardInterval)
Copyright © 2023 Frank!Framework. All rights reserved.