This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Configuring JMS Operations
The JMS connector implementation requires an active JMS server instance to be able to send messages. We recommend WSO2 Message Broker or Apache ActiveMQ, but other implementations such as Apache Qpid and Tibco are also supported. For information on how to configure the JMS transport with the most common broker servers that can be integrated with WSO2 ESB, see Configuring the JMS Transport.
To use the JMS connector, add the <jms.init>
element in your configuration before carrying out any other JMS producer operation.
<jms.init> <connectionFactoryName>QueueConnectionFactory</connectionFactoryName> <javaNamingProviderUrl>tcp://localhost:61616</javaNamingProviderUrl> <javaNamingFactoryInitial>org.apache.activemq.jndi.ActiveMQInitialContextFactory</javaNamingFactoryInitial> <destinationType>queue</destinationType> <connectionPoolSize>20</connectionPoolSize> <destinationName>MyQueue</destinationName> </jms.init>
properties
connectionFactoryName
: Required - The name of the object to look up.javaNamingFactoryInitial
: Required - The JNDI initial context factory class. The class must implement thejava.naming.spi.InitialContextFactory
interface.destinationType
: Required - The type of the destination. Possible values arequeue
ortopic
.connectionPoolSize
: Required - The maximum number of connections to store in the pool.(For example., 20)destinationName
: Required - The name of the queue/topic.javaNamingProviderUrl
: Required - The URL of the JNDI provider.priority
: The message priority for the message producer. This should be a value between 0 and 9. The default value is 4.deliveryMode
: The message delivery mode for the message producer. Possible values areNON_PERSISTENT
andPERSISTENT
. The default delivery mode isPERSISTENT
.timeToLive
: The message time to live in milliseconds. The default value is zero, which means by default the time to live is unlimited.username
: The user name to authenticate with the broker.password
: The password to authenticate with the broker.connectionPoolSize
: The number of message requests that can share the JMS connection.Performance tuning tip
For better throughput, configure the
connectionPoolSize
parameter in the<init>
configuration as follows:<connectionPoolSize>20</connectionPoolSize>
If you do not specify the
connectionPoolSize
parameter in the<init>
configuration, a JMS connection is created for each message request.