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 Transport
WSO2 ESB's JMS transport allows you to easily send and receive messages to queues and topics of any JMS service, which implements the JMS specification. The JMS transport adapter used by WSO2 ESB comes from the Apache Axis2 project, and it makes use of JNDI to connect to various JMS brokers. As a result, WSO2 ESB can work with any JMS broker that offers JNDI support.
WSO2 ESB comes with default sample configurations for Apache ActiveMQ integration. All relevant classes are packed in axis2-transport-jms-1.1.0.jar and the classes org.apache.axis2.transport.jms.JMSListener and org.apache.axis2.transport.jms.JMSSender act as the transport receiver and sender respectively. The JMS transport implementation requires an active JMS server instance to be able to receive and send messages. We recommend using WSO2 Message Broker or Apache ActiveMQ, but other implementations such as Apache Qpid and Tibco are also supported. Find configuration details for most of the common broker servers that can be integrated with WSO2 ESB in the following topics:
- Configure with WSO2 Message Broker
- Configure with ActiveMQ
- Configure with IBM WebSphere MQ
- Configure with IBM WebSphere Application Server
- Configure with MSMQ
- Configure with Tibco EMS
- Configure with SwiftMQ
JMS Connection Factory Parameters
Configuration parameters for JMS receiver and sender in <ESB_HOME>/repository/conf/axis2/axis2.xml file are XML fragments that represent JMS connection factories. The table below lists the JMS connection factory parameters, which are used when configuring the ESB with any broker server.
Parameter Name | Description | Mandatory/Optional | Possible Values | Default Value |
---|---|---|---|---|
java.naming.factory.initial | JNDI initial context factory class. The class must implement the java.naming.spi.InitialContextFactory interface. | Mandatory | A valid class name | |
java.naming.provider.url | URL of the JNDI provider | Mandatory | A valid URL | |
java.naming.security.principal | JNDI Username | Optional | ||
java.naming.security.credentials | JNDI password | Optional | ||
transport.Transactionality | Desired mode of transactionality | Optional | none, local, jta | none |
transport.UserTxnJNDIName | JNDI name to be used to require user transaction | Optional | java:comp/UserTransaction | |
transport.CacheUserTxn | Whether caching for user transactions should be enabled or not | Optional | true, false | true |
transport.jms.SessionTransacted | Whether the JMS session be transacted or not | Optional | true, false | true if transactionality is 'local' |
transport.jms.SessionAcknowledgement | JMS session acknowledgement mode | Optional | AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED | AUTO_ACKNOWLEDGE |
transport.jms.ConnectionFactoryJNDIName | The JNDI name of the connection factory | Mandatory | ||
transport.jms.ConnectionFactoryType | Type of the connection factory | Optional | queue, topic | queue |
transport.jms.JMSSpecVersion | JMS API version | Optional | 1.1, 1.0.2b | 1.1 |
transport.jms.UserName | The JMS connection username | Optional | ||
transport.jms.Password | The JMS connection password | Optional | ||
transport.jms.Destination | The JNDI name of the destination | Optional | Defaults to service name | |
transport.jms.DestinationType | Type of the destination | Optional | queue, topic | queue |
transport.jms.DefaultReplyDestination | JNDI name of the default reply destination | Optional | ||
transport.jms.DefaultReplyDestinationType | Type of the reply destination | Optional | queue, topic | Defaults to the type of the destination |
transport.jms.MessageSelector | Message selector implementation | Optional | ||
transport.jms.SubscriptionDurable | Whether the connection factory is subscription durable or not | Optional | true, false | false |
transport.jms.DurableSubscriberClientID | The ClientId parameter when using durable subscriptions | Mandatory if the subscription durable is turned on | true, false | |
transport.jms.DurableSubscriberName | Name of the durable subscriber | Mandatory if the subscription durable is turned on | ||
transport.jms.PubSubNoLocal | Whether the messages should be published by the same connection they were received | Optional | true, false | false |
transport.jms.CacheLevel | JMS resource cache level | Optional | none, connection, session, consumer, producer, auto | auto |
transport.jms.ReceiveTimeout | Time to wait for a JMS message during polling. Set this parameter value to a negative integer to wait indefinitely. Set to zero to prevent waiting. | Optional | Number of milliseconds to wait | 1000 ms |
transport.jms.ConcurrentConsumers | Number of concurrent threads to be started to consume messages when polling. | Optional | Any positive integer - For topics this must be always 1 | 1 |
transport.jms.MaxConcurrentConsumers | Maximum number of concurrent threads to use during polling. | Optional | Any positive integer - For topics this must be always 1 | 1 |
transport.jms.IdleTaskLimit | The number of idle runs per thread before it dies out | Optional | Any positive integer | 10 |
transport.jms.MaxMessagesPerTask | The maximum number of successful message receipts per thread | Optional | Any positive integer - Use -1 to indicate infinity | -1 |
transport.jms.InitialReconnectDuration | Initial reconnection attempts duration in milliseconds | Optional | Any positive integer | 10000 ms |
transport.jms.ReconnectProgressFactor | Factor by which the reconnection duration will be increased | Optional | Any positive integer | 2 |
transport.jms.MaxReconnectDuration | Maximum reconnection duration in milliseconds | Optional | 3600000 ms (1 hr) |
JMS transport implementation has some parameters that should be configured at service-level, in the service.xml file of each service.
Service-Level JMS Configuration Parameters
Parameter Name | Description | Mandatory/Optional | Possible Values | Default Value |
---|---|---|---|---|
transport.jms.ConnectionFactory | Name of the JMS connection factory the service should use | Optional | A name of an already defined connection factory | default |
transport.jms.PublishEPR | JMS EPR to be published in the WSDL | Optional | A JMS EPR |