public class JmsListenerBase extends JMSFacade implements HasSender, IWithParameters, IRedeliveringListener<javax.jms.Message>
JMSFacade.AcknowledgeMode, JMSFacade.DeliveryMode, JMSFacade.DestinationType, JMSFacade.SubscriberType
messagingSource
Constructor and Description |
---|
JmsListenerBase() |
Modifier and Type | Method and Description |
---|---|
void |
addParameter(Parameter p) |
void |
afterMessageProcessed(PipeLineResult plr,
Object rawMessageOrWrapper,
Map<String,Object> threadContext)
Called to perform actions (like committing or sending a reply) after a message has been processed by the
Pipeline.
|
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. |
Message |
extractMessage(javax.jms.Message rawMessage,
Map<String,Object> threadContext)
Extracts string from message obtained from getRawMessage.
|
String |
getIdFromRawMessage(javax.jms.Message rawMessage,
Map<String,Object> threadContext)
Fill in thread-context with things needed by the JMSListener code.
|
protected Map<String,Object> |
getMessageProperties(Map<String,Object> threadContext)
Set additional message headers/properties on the JMS response, read after message has been processed!
|
ParameterList |
getParameterList()
return the Parameters
|
boolean |
messageWillBeRedeliveredOnExitStateError(Map<String,Object> context) |
void |
open()
Obtains a connection and a serviceQueue.
|
Message |
prepareReply(Message rawReply,
Map<String,Object> threadContext) |
Message |
prepareReply(Message rawReply,
Map<String,Object> threadContext,
String soapHeader) |
protected String |
retrieveIdFromMessage(javax.jms.Message message,
Map<String,Object> threadContext) |
protected void |
sendReply(PipeLineResult plr,
javax.jms.Destination replyTo,
String replyCid,
long timeToLive,
boolean ignoreInvalidDestinationException,
Map<String,Object> threadContext,
Map<String,Object> properties) |
void |
setForceMessageIdAsCorrelationId(boolean force)
By default, the JmsListener takes the Correlation-ID (if present) as the ID that has to be used as Correlation-ID of the reply.
|
void |
setReplyDeliveryMode(JMSFacade.DeliveryMode replyDeliveryMode)
Controls mode that reply messages are sent with
|
void |
setReplyDestinationName(String destinationName)
Name of the JMS destination (queue or topic) to use for sending replies.
|
void |
setReplyEncodingStyleURI(String string) |
void |
setReplyMessageTimeToLive(long l)
Time in milliseconds after which the reply-message will expire
|
void |
setReplyMessageType(String string)
Value of the JMSType field of the reply message
|
void |
setReplyNamespaceURI(String string) |
void |
setReplyPriority(int i)
Sets the priority that is used to deliver the reply message.
|
void |
setReplySoapAction(String string) |
void |
setSender(ISender newSender)
Deprecated.
|
void |
setSoap(boolean b)
If
true , messages sent are put in a SOAP envelope |
void |
setSoapHeaderSessionKey(String string)
sessionKey to store the SOAP header of the incoming message
|
void |
setTimeout(long newTimeOut)
Receive timeout in milliseconds as specified by the JMS API, see https://docs.oracle.com/javaee/7/api/javax/jms/MessageConsumer.html#receive-long-
|
void |
setTimeOut(long newTimeOut)
Deprecated.
|
void |
setUseReplyTo(boolean newUseReplyTo) |
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, setDestinationName, 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
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 JndiBase
ConfigurationException
public void open() throws ListenerException
JMSFacade
open
in interface IListener<javax.jms.Message>
open
in class JMSFacade
ListenerException
public void close()
JMSFacade
public String getIdFromRawMessage(javax.jms.Message rawMessage, Map<String,Object> threadContext) throws ListenerException
getIdFromRawMessage
in interface IListener<javax.jms.Message>
rawMessage
- - Original message received, can not be null
threadContext
- - Thread context to be populated, can not be null
ListenerException
protected String retrieveIdFromMessage(javax.jms.Message message, Map<String,Object> threadContext) throws ListenerException
ListenerException
public Message extractMessage(javax.jms.Message rawMessage, Map<String,Object> threadContext) throws ListenerException
extractMessage
in interface IListener<javax.jms.Message>
ListenerException
public Message prepareReply(Message rawReply, Map<String,Object> threadContext) throws ListenerException
ListenerException
public Message prepareReply(Message rawReply, Map<String,Object> threadContext, String soapHeader) throws ListenerException
ListenerException
public void afterMessageProcessed(PipeLineResult plr, Object rawMessageOrWrapper, Map<String,Object> threadContext) throws ListenerException
IListener
afterMessageProcessed
in interface IListener<javax.jms.Message>
ListenerException
public boolean messageWillBeRedeliveredOnExitStateError(Map<String,Object> context)
messageWillBeRedeliveredOnExitStateError
in interface IRedeliveringListener<javax.jms.Message>
protected void sendReply(PipeLineResult plr, javax.jms.Destination replyTo, String replyCid, long timeToLive, boolean ignoreInvalidDestinationException, Map<String,Object> threadContext, Map<String,Object> properties) throws SenderException, ListenerException, NamingException, javax.jms.JMSException, IOException
SenderException
ListenerException
NamingException
javax.jms.JMSException
IOException
@Deprecated public void setSender(ISender newSender)
protected Map<String,Object> getMessageProperties(Map<String,Object> threadContext)
threadContext
- which has been build during the pipelinepublic void addParameter(Parameter p)
addParameter
in interface IWithParameters
public ParameterList getParameterList()
getParameterList
in interface IWithParameters
public void setForceMessageIdAsCorrelationId(boolean force)
true
, the messageID is used as Correlation-ID of the reply.@Deprecated public void setTimeOut(long newTimeOut)
public void setTimeout(long newTimeOut)
public void setUseReplyTo(boolean newUseReplyTo)
public void setReplyDestinationName(String destinationName)
useReplyTo
=true
,
the sender specified reply destination takes precedence over this one.public void setReplyMessageType(String string)
public void setReplyDeliveryMode(JMSFacade.DeliveryMode replyDeliveryMode)
public void setReplyPriority(int i)
-1
means not set and thus uses the JMS defaultpublic void setReplyMessageTimeToLive(long l)
public void setSoap(boolean b)
true
, messages sent are put in a SOAP envelopepublic void setReplyEncodingStyleURI(String string)
public void setReplyNamespaceURI(String string)
public void setReplySoapAction(String string)
public void setSoapHeaderSessionKey(String string)
Copyright © 2023 Frank!Framework. All rights reserved.