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:

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 NameDescriptionMandatory/OptionalPossible ValuesDefault Value
java.naming.factory.initialJNDI initial context factory class. The class must implement the java.naming.spi.InitialContextFactory interface.MandatoryA valid class name 
java.naming.provider.urlURL of the JNDI providerMandatoryA valid URL 
java.naming.security.principalJNDI UsernameOptional  
java.naming.security.credentialsJNDI passwordOptional  
transport.TransactionalityDesired mode of transactionalityOptionalnone, local, jtanone
transport.UserTxnJNDINameJNDI name to be used to require user transactionOptional java:comp/UserTransaction
transport.CacheUserTxnWhether caching for user transactions should be enabled or notOptionaltrue, falsetrue
transport.jms.SessionTransactedWhether the JMS session be transacted or notOptionaltrue, falsetrue if transactionality is 'local'
transport.jms.SessionAcknowledgementJMS session acknowledgement modeOptionalAUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTEDAUTO_ACKNOWLEDGE
transport.jms.ConnectionFactoryJNDINameThe JNDI name of the connection factoryMandatory  
transport.jms.ConnectionFactoryTypeType of the connection factoryOptionalqueue, topicqueue
transport.jms.JMSSpecVersionJMS API versionOptional1.1, 1.0.2b1.1
transport.jms.UserNameThe JMS connection usernameOptional  
transport.jms.PasswordThe JMS connection passwordOptional  
transport.jms.DestinationThe JNDI name of the destinationOptional Defaults to service name
transport.jms.DestinationTypeType of the destinationOptionalqueue, topicqueue
transport.jms.DefaultReplyDestinationJNDI name of the default reply destinationOptional  
transport.jms.DefaultReplyDestinationTypeType of the reply destinationOptionalqueue, topicDefaults to the type of the destination
transport.jms.MessageSelectorMessage selector implementationOptional  
transport.jms.SubscriptionDurableWhether the connection factory is subscription durable or notOptionaltrue, falsefalse
transport.jms.DurableSubscriberClientIDThe ClientId parameter when using durable subscriptionsMandatory if the subscription durable is turned ontrue, false 
transport.jms.DurableSubscriberNameName of the durable subscriberMandatory if the subscription durable is turned on  
transport.jms.PubSubNoLocalWhether the messages should be published by the same connection they were receivedOptionaltrue, falsefalse
transport.jms.CacheLevelJMS resource cache levelOptionalnone, connection, session, consumer, producer, autoauto
transport.jms.ReceiveTimeoutTime 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.OptionalNumber of milliseconds to wait1000 ms
transport.jms.ConcurrentConsumersNumber of concurrent threads to be started to consume messages when polling.OptionalAny positive integer - For topics this must be always 11
transport.jms.MaxConcurrentConsumersMaximum number of concurrent threads to use during polling.OptionalAny positive integer - For topics this must be always 11
transport.jms.IdleTaskLimitThe number of idle runs per thread before it dies outOptionalAny positive integer10
transport.jms.MaxMessagesPerTaskThe maximum number of successful message receipts per threadOptionalAny positive integer - Use -1 to indicate infinity-1
transport.jms.InitialReconnectDurationInitial reconnection attempts duration in millisecondsOptionalAny positive integer10000 ms
transport.jms.ReconnectProgressFactorFactor by which the reconnection duration will be increasedOptionalAny positive integer2
transport.jms.MaxReconnectDurationMaximum reconnection duration in millisecondsOptional 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 NameDescriptionMandatory/OptionalPossible ValuesDefault Value
transport.jms.ConnectionFactoryName of the JMS connection factory the service should useOptionalA name of an already defined connection factorydefault
transport.jms.PublishEPRJMS EPR to be published in the WSDLOptionalA JMS EPR