Package org.frankframework.jms
Class JmsSender
java.lang.Object
org.frankframework.jndi.JndiBase
org.frankframework.jms.JMSFacade
org.frankframework.jms.JmsSender
- All Implemented Interfaces:
AdapterAware
,HasPhysicalDestination
,IConfigurable
,IConfigurationAware
,ICorrelatedSender
,INamedObject
,IScopeProvider
,ISender
,ISenderWithParameters
,IWithParameters
,IXAEnabled
,HasStatistics
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class JmsSender
extends JMSFacade
implements ISenderWithParameters, HasStatistics, AdapterAware, ICorrelatedSender
This class sends messages with JMS.
- Author:
- Gerrit van Brakel
- Parameters
- All parameters present are set as message-properties.
- Specific parameters
- SoapAction Automatically filled from attribute
soapAction
-
Nested Class Summary
Nested classes/interfaces inherited from class org.frankframework.jms.JMSFacade
JMSFacade.AcknowledgeMode, JMSFacade.DeliveryMode, JMSFacade.DestinationType, JMSFacade.MessageClass, JMSFacade.SubscriberType
-
Field Summary
Fields inherited from class org.frankframework.jms.JMSFacade
JMS_MESSAGECLASS_KEY, messagingSource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Configures the senderprotected jakarta.jms.Session
Returns a session on the connection for a topic or a queuejakarta.jms.Destination
getDestination
(PipeLineSession session, ParameterValueList pvl) int
int
boolean
isSoap()
boolean
Whentrue
, the result of sendMessage is the reply of the request.sendMessage
(Message message, PipeLineSession session) Send a message to some destination (as configured in the Sender object).sendMessage
(Message message, PipeLineSession pipeLineSession, String soapHeader) void
setAdapter
(Adapter adapter) void
setConfigurationMetrics
(MetricsInitializer configurationMetrics) void
setDeliveryMode
(JMSFacade.DeliveryMode deliveryMode) Controls mode that messages are sent withvoid
setDestinationParam
(String string) Parameter that is used, if specified and not empty, to determine the destination.void
setEncodingStyleURI
(String string) SOAP encoding style URIvoid
setLinkMethod
(JmsSender.LinkMethod method) (Only used whensynchronous=true
andreplyToName
is set).void
setMessageType
(String string) Value of the JMSType fieldvoid
setPriority
(int i) Sets the priority that is used to deliver the message.void
setReplySoapHeaderSessionKey
(String string) session key to store SOAP header of replyvoid
setReplyTimeout
(int i) (Only forsynchronous=true
).void
setReplyToName
(String replyTo) Name of the queue the reply is expected on.void
setResponseHeadersToSessionKeys
(String responseHeaders) A list of JMS headers of the response to add to the PipeLineSessionvoid
setServiceNamespaceURI
(String string) SOAP service namespace URIvoid
setSoap
(boolean b) Iftrue
, messages sent are put in a SOAP envelopevoid
setSoapAction
(String string) SOAPAction string sent as message propertyvoid
setSoapHeaderParam
(String string) Name of parameter containing SOAP headervoid
setSynchronous
(boolean synchronous) Iftrue
, the sender operates in RR mode: A reply is expected, either on the queue specified inreplyToName
, or on a dynamically generated temporary queuevoid
start()
Starts the sendertoString()
Methods inherited from class org.frankframework.jms.JMSFacade
checkTransactionManagerValidity, closeSession, createBytesMessage, createMessage, createMessage, 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, stop
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.springframework.context.ApplicationContextAware
setApplicationContext
Methods inherited from interface org.frankframework.core.IConfigurationAware
getApplicationContext, getName
Methods inherited from interface org.frankframework.core.INamedObject
getName, setName
Methods inherited from interface org.frankframework.core.IScopeProvider
getConfigurationClassLoader
Methods inherited from interface org.frankframework.core.ISender
sendMessageOrThrow, stop
Methods inherited from interface org.frankframework.core.ISenderWithParameters
consumesSessionVariable
-
Field Details
-
paramList
-
-
Constructor Details
-
JmsSender
public JmsSender()
-
-
Method Details
-
configure
Configures the sender- Specified by:
configure
in interfaceIConfigurable
- Specified by:
configure
in interfaceISender
- Overrides:
configure
in classJMSFacade
- Throws:
ConfigurationException
-
createSession
Description copied from class:JMSFacade
Returns a session on the connection for a topic or a queue- Overrides:
createSession
in classJMSFacade
- Throws:
JmsException
-
start
public void start()Starts the sender -
addParameter
- Specified by:
addParameter
in interfaceIWithParameters
-
getParameterList
- Specified by:
getParameterList
in interfaceIWithParameters
-
sendMessage
@Nonnull public SenderResult sendMessage(@Nonnull Message message, @Nonnull PipeLineSession session) throws SenderException, TimeoutException Description copied from interface:ISender
Send a message to some destination (as configured in the Sender object). This method may only be called after theconfigure()
method is called.The following table shows the difference between synchronous and a-synchronous senders:
synchronous a-synchronous ISender.isSynchronous()
returnstrue
false
return value of sendMessage()
isthe reply-message the messageId of the message sent the correlationID specified with sendMessage()
may be ignored is sent with the message a {link TimeOutException} may be thrown if a timeout occurs waiting for a reply should not be expected Multiple objects may try to call this method at the same time, from different threads. Implementations of this method should therefore be thread-safe, or
synchronized
.- Specified by:
sendMessage
in interfaceISender
- Throws:
SenderException
TimeoutException
-
sendMessage
@Nonnull public Message sendMessage(@Nonnull Message message, @Nonnull PipeLineSession pipeLineSession, String soapHeader) throws SenderException, TimeoutException - Throws:
SenderException
TimeoutException
-
getDestination
public jakarta.jms.Destination getDestination(PipeLineSession session, ParameterValueList pvl) throws JmsException, NamingException, jakarta.jms.JMSException - Throws:
JmsException
NamingException
jakarta.jms.JMSException
-
toString
-
setDestinationParam
Parameter that is used, if specified and not empty, to determine the destination. Overrides thedestination
attribute -
setSynchronous
public void setSynchronous(boolean synchronous) Iftrue
, the sender operates in RR mode: A reply is expected, either on the queue specified inreplyToName
, or on a dynamically generated temporary queue- Default value
- false
-
setReplyToName
Name of the queue the reply is expected on. This value is sent in the JMSReplyTo-header with the message.- Default value
- a dynamically generated temporary destination
-
setLinkMethod
(Only used whensynchronous=true
andreplyToName
is set). Indicates whether the server uses the correlationId from the pipeline, the correlationId from the message or the messageId in the correlationId field of the reply. This requires the sender to have set the correlationId at the time of sending.- Default value
- MESSAGEID
-
setReplyTimeout
public void setReplyTimeout(int i) (Only forsynchronous=true
). Maximum time in ms to wait for a reply. 0 means no timeout.- Default value
- 5000
-
setMessageType
Value of the JMSType field- Default value
- not set by application
-
setDeliveryMode
Controls mode that messages are sent with- Default value
- not set by application
-
setPriority
public void setPriority(int i) Sets the priority that is used to deliver the message. Ranges from 0 to 9. Defaults to -1, meaning not set. Effectively the default priority is set by JMS to 4- Default value
- -1
-
setSoap
public void setSoap(boolean b) Iftrue
, messages sent are put in a SOAP envelope- Default value
- false
-
setEncodingStyleURI
SOAP encoding style URI -
setServiceNamespaceURI
SOAP service namespace URI -
setSoapAction
SOAPAction string sent as message property -
setSoapHeaderParam
Name of parameter containing SOAP header- Default value
- soapHeader
-
setReplySoapHeaderSessionKey
session key to store SOAP header of reply- Default value
- replySoapHeader
-
setResponseHeadersToSessionKeys
A list of JMS headers of the response to add to the PipeLineSession -
getReplyToName
-
getDeliveryMode
-
getMessageType
-
getPriority
public int getPriority() -
isSynchronous
public boolean isSynchronous()Description copied from interface:ISender
Whentrue
, the result of sendMessage is the reply of the request.- Specified by:
isSynchronous
in interfaceISender
-
getReplyTimeout
public int getReplyTimeout() -
getReplySoapHeaderSessionKey
-
isSoap
public boolean isSoap() -
getEncodingStyleURI
-
getServiceNamespaceURI
-
getSoapAction
-
getSoapHeaderParam
-
getLinkMethod
-
getDestinationParam
-
setConfigurationMetrics
-
getResponseHeadersList
-
getAdapter
- Specified by:
getAdapter
in interfaceHasStatistics
-
setAdapter
- Specified by:
setAdapter
in interfaceAdapterAware
-