Skip to content

JMS Parameters

When you implement an integration use case that requires a JMS connection, you can use the following JMS parameters in your proxy service artifact.

Info

The Micro Integrator can listen to a JMS instance or send messages to a JMS instance only if the JMS transport listener and sender are enabled and configured at the server level. Read about the JMS transport.

To add service-level transport parameters to a proxy service:

  1. Open your proxy service artifact in WSO2 Integration Studio.
  2. In the Design View, go to the Properties tab and expand the Parameters section as shown below.

  3. Click the plus icon to open the following dialog box and add the parameter name and value as a key-value pair:

See Creating a Proxy Service for instructions.

Service-Level JMS 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.

JMS connection factory parameters

The JMS connection factory parameters can be specified at the server level or the service level. Given below are the complete list of connection factory parameters (with a comparison of service-level and server-level parameter names).

Tip

To define the parameters at the server level, you need to update the JMS configurations in the deployment.toml file. See the configuration catalog for details on how to apply server configurations.

Service-Level Parameter

Server Parameter

Description

java.naming.factory.initial parameter.initial_naming_factory 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 parameter.provider_url URL of the JNDI provider. By default, the value is tcp://localhost:61616.
java.naming.security.principal parameter.naming_security_principal

JNDI Username.

java.naming.security.credentials parameter.naming_security_credential

JNDI password.

transport.Transactionality parameter.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 parameter.transaction_jndi_name JNDI name to be used to require user transaction. The default value is java:comp/UserTransaction.
transport.CacheUserTxn parameter.cache_user_transaction Whether caching for user transactions should be enabled or not. By default, this setting is true.
transport.jms.SessionTransacted parameter.session_transaction Whether the JMS session should be transacted or not. By default, this setting is true (if transactionality is 'local').
transport.jms.SessionAcknowledgement parameter.session_acknowledgement 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 parameter.connection_factory_name The JNDI name of the connection factory.

The possible values are as follows:
  • QueueConnectionFactory
  • TopicConnectionFactory
transport.jms.ConnectionFactoryType parameter.connection_factory_type Type of the connection factory. The possible values are queue, or topic. The default value is queue.
transport.jms.JMSSpecVersion parameter.jms_spec_version JMS API version. Possible values are 1.1 or 1.0.2b. The default value is 1.1.
transport.jms.UserName parameter.username The JMS connection username.
transport.jms.Password parameter.password The JMS connection password.
transport.jms.Destination parameter.destination The JNDI name of the destination.
transport.jms.DestinationType parameter.destination_type Type of the destination. Possible values are queue, or topic. The default setting is queue.
transport.jms.DefaultReplyDestination parameter.default_reply_destination JNDI name of the default reply destination.
transport.jms.DefaultReplyDestinationType parameter.default_destination_type Type of the reply destination. Possible values are queue, or topic. Defaults to the type of the destination.
transport.jms.MessageSelector parameter.message_selector Message selector implementation.
transport.jms.SubscriptionDurable parameter.subscription_durable Whether the connection factory is subscription durable or not. By default, this parameter is set to false.
transport.jms.DurableSubscriberClientID parameter.durable_subscriber_client_id The ClientId parameter when using durable subscriptions. This parameter is required if the value specified as transport.jms.ubscriptionDurable is true.
transport.jms.DurableSubscriberName parameter.durable_subscriber_name The name of the durable subscriber. This parameter is required if the value specified as transport.jms.SubscriptionDurable is true.
transport.jms.PubSubNoLocal parameter.pub_sub_local Whether the messages should be published by the same connection through which they were received. The default setting is false.
transport.jms.CacheLevel parameter.cache_level 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 parameter.receive_timeout 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 parameter.concurrent_consumer 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 parameter.max_concurrent_consumer Maximum number of concurrent threads to use during polling. You can specify any positive integer. The default value is 1.
transport.jms.IdleTaskLimit parameter.idle_task_limit 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 parameter.max_message_per_task

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 parameter.initial_reconnection_duration Initial reconnection attempts duration in milliseconds. You can specify any positive integer. The default value is 10000 milliseconds.
transport.jms.ReconnectProgressFactor parameter.reconnect_progress_factor Factor by which the reconnection duration will be increased. You can specify any positive integer. The default value is 2.
transport.jms.MaxReconnectDuration parameter.max_reconnect_duration Maximum reconnection duration in milliseconds. The default value is 3600000 milliseconds (1 hour).
transport.jms.ReconnectInterval parameter.reconnect_interval Reconnection interval in milliseconds. The default value is 3600000 milliseconds (1 hour).
transport.jms.MaxJMSConnections parameter.max_jsm_connection Maximum cached JMS connections in the producer level. You can specify any positive integer. The default value is 10.
transport.jms.MaxConsumeErrorRetriesBeforeDelay parameter.max_consumer_error_retrieve_before_delay 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 parameter.consume_error_delay 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 parameter.consume_error_progression 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 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.
Top