Skip to content

JMS Transport Parameters

About the JMS transport

The Java Message Service (JMS) transport in WSO2 Micro Integrator allows you to easily send and receive messages to queues and topics of any JMS service that implements the JMS specification.

Java Message Service (JMS) is a widely used API in Java-based Message Oriented Middleware(MOM) applications. It facilitates loosely coupled, reliable, and asynchronous communication between different components of a distributed application. It supports two asynchronous communication models for messaging as follows:

  • Point-to-point model: In this model message communication happens from one JMS client to another JMS client through a dedicated queue.
  • Publish and subscribe model:  In this model message communication happens from one JMS client(publisher) to many JMS clients(subscribers) through a topic.
JMS supports two models for messaging as follows:
  • Queues: point-to-point.
  • Topics: publish and subscribe.
The Micro Integrator supports the following messaging features introduced with JMS 2.0:
  • Shared Topic Subscription
  • JMSX Delivery Count
  • JMS Message Delivery Delay
The JMS transport implementation comes from the WS-Commons Transports project, and it makes use of JNDI to connect to various JMS brokers. As a result, WSO2 Micro Integrator can work with any JMS broker that offers JNDI support.

Parameters

Given below is the list of JMS transport parameters that can be configured when you create a proxy service.

JMS connection factory parameters

Configuration parameters for the JMS receiver and the sender are XML fragments that represent JMS connection factories.

Parameter Name

Description

java.naming.factory.initial JNDI initial context factory class. The class must implement the java.naming.spi.InitialContextFactory interface. The default value is org.apache.activemq.jndi.ActiveMQInitialContextFactory.
java.naming.provider.url URL of the JNDI provider. By default, the value is tcp://localhost:61616.
java.naming.security.principal

JNDI Username.

java.naming.security.credentials

JNDI password.

transport.Transactionality Preferred mode of transactionality.
Note: In the Micro Integrator, JMS transactions only work with either the Callout mediator or the Call mediator in blocking mode. The possible values are as follows:
  • none: Disables transactions in the JMS transport.
  • local: Enables local JMS session transactions.
  • jta: Enables global JTA transactions.
transport.UserTxnJNDIName JNDI name to be used to require user transaction. The default value is java:comp/UserTransaction.
transport.CacheUserTxn Whether caching for user transactions should be enabled or not. By default, this setting is true.
transport.jms.SessionTransacted Whether the JMS session should be transacted or not. By default, this setting is true (if transactionality is 'local').
transport.jms.SessionAcknowledgement JMS session acknowledgment mode. The possible values are as follows:
  • AUTO_ACKNOWLEDGE: The session automatically acknowledges the consumer receipt of messages when message processing has finished.
  • CLIENT_ACKNOWLEDGE: The consumer acknowledges all messages delivered so far by the session. If the consumer falls behind in its processing, a large number of unacknowledged messages can build up.
  • DUPS_OK_ACKNOWLEDGE: The session lazily acknowledges the delivery of messages to the consumer. Lazy means that the consumer can delay acknowledgement to the server until a convenient time. During a delay, the server might redeliver messages. This mode reduces session overhead but the consumer can receive duplicate messages should JMS fail,
  • SESSION_TRANSACTED: The session is a related group of consumed or produced messages that are treated as a single unit of work.
Also see JMS Message Delivery Reliability and Acknowledgement Patterns.
transport.jms.ConnectionFactoryJNDIName The JNDI name of the connection factory.

The possible values are as follows:
  • QueueConnectionFactory
  • TopicConnectionFactory
transport.jms.ConnectionFactoryType Type of the connection factory. The possible values are queue, or topic. The default value is queue.
transport.jms.JMSSpecVersion JMS API version. Possible values are 1.1 or 1.0.2b. The default value is 1.1.
transport.jms.UserName The JMS connection username.
transport.jms.Password The JMS connection password.
transport.jms.Destination The JNDI name of the destination.
transport.jms.DestinationType Type of the destination. Possible values are queue, or topic. The default setting is queue.
transport.jms.DefaultReplyDestination JNDI name of the default reply destination.
transport.jms.DefaultReplyDestinationType Type of the reply destination. Possible values are queue, or topic. Defaults to the type of the destination.
transport.jms.MessageSelector Message selector implementation.
transport.jms.SubscriptionDurable Whether the connection factory is subscription durable or not. By default, this parameter is set to false.
transport.jms.DurableSubscriberClientID The ClientId parameter when using durable subscriptions. This parameter is required if the value specified as transport.jms.ubscriptionDurable is true.
transport.jms.DurableSubscriberName The name of the durable subscriber. This parameter is required if the value specified as transport.jms.SubscriptionDurable is true.
transport.jms.PubSubNoLocal Whether the messages should be published by the same connection through which they were received. The default setting is false.
transport.jms.CacheLevel The cache level with which JMS objects should be cached at start up. You can configure this in the ei.toml file if Micro Integrator acts as a JMS producer. Example:
<endpoint>
   <address uri="jms:/example.MyQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/jndi.properties&transport.jms.DestinationType=queue&transport.jms.CacheLevel=producer"/>
</endpoint>
If the Micro Integrator is a JMS consumer, you can configure a proxy service. Following are the possible values for this parameter:
  • none: None of the JMS objects will be cached.
  • connection: JMS connection objects will be cached.
  • session: JMS connection and session objects will be cached.
  • consumer: JMS connection, session, and consumer objects will be cached.
  • producer: JMS connection, session, and producer objects will be cached.
  • auto: An appropriate cache level will be used based on the transaction strategy.
By default, this parameter is set to 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. The default value is 1000 milliseconds.
transport.jms.ConcurrentConsumers Number of concurrent threads to be started to consume messages when polling. You can specify any positive integer. However, for topics, this parameters should always be set to 1.
transport.jms.MaxConcurrentConsumers Maximum number of concurrent threads to use during polling. You can specify any positive integer. The default value is 1.
transport.jms.IdleTaskLimit The number of idle runs per thread before it dies out. You can specify any positive integer. The default value is 10.
transport.jms.MaxMessagesPerTask

The maximum number of successful message receipts per thread. You can specify any positive integer. The default value is -1. Use -1 to indicate infinity.

transport.jms.InitialReconnectDuration Initial reconnection attempts duration in milliseconds. You can specify any positive integer. The default value is 10000 milliseconds.
transport.jms.ReconnectProgressFactor Factor by which the reconnection duration will be increased. You can specify any positive integer. The default value is 2.
transport.jms.MaxReconnectDuration Maximum reconnection duration in milliseconds. The default value is 3600000 milliseconds (1 hour).
transport.jms.ReconnectInterval Reconnection interval in milliseconds. The default value is 3600000 milliseconds (1 hour).
transport.jms.MaxJMSConnections Maximum cached JMS connections in the producer level. You can specify any positive integer. The default value is 10.
transport.jms.MaxConsumeErrorRetriesBeforeDelay Number of retries on consume errors before sleep delay kicks in. You can specify any positive integer. The default value is 20.
transport.jms.ConsumeErrorDelay Sleep delay when a consume error is encountered (in milliseconds). You can specify any positive integer. The default value is 100 milliseconds.
transport.jms.ConsumeErrorProgression Factor by which the consume error retry sleep will be increased. You can specify any positive integer. The default value is 2.0.
transport.jms.MaxConsumeErrorRetryCount The maximum number of times the consumer should retry upon receiving a consumer error. You need to introduce this parameter only if the Broker has issues in notifying the Exception Listeners about the exceptions occurred. You can specify any positive integer. The default value is 1.

Service-level JMS configuration parameters

Parameter Name Description
transport.jms.ConnectionFactory Name of the JMS connection factory the service should use. You can specify the name of an already defined connection factory
transport.jms.PublishEPR JMS EPR to be published in the WSDL. Specify a JMS EPR.
transport.jms.ContentType Specifies how the transport listener should determine the content type of received messages. Specify a simple string value, in which case the transport listener assumes that the received messages always have the specified content type, or a set of rules. For more information, see http://axis.apache.org/axis2/java/transports/jms.html#Service_configuration.
transport.jms.MessagePropertyHyphens Specifies the action to be taken when there are JMS Message property names that contain hyphens. The possible values are as follows:
  • none: No action will be taken. This is the default value.
  • replace: Transport headers with hyphens will be replaced before adding them as JMS message properties, and if the Micro Integrator is the consumer, hyphens will be reintroduced on message retrieval.
  • delete: Transport headers with hyphens will be deleted.
Top