Contact Us 1-800-596-4880

JMS Transport Reference

JMS (Java Message Service) is a widely-used API for Message Oriented Middleware. It allows communication between different components of a distributed application to be loosely coupled, reliable, and asynchronous.

JMS supports two models for messaging:

  • Queues - Point-to-point

  • Topics - Publish and subscribe

Mule’s JMS transport lets you easily send and receive messages to queues and topics for any message service which implements the JMS specification.

Transport Info

Transport JMS

Doc

JavaDoc

Inbound

SchemaDoc

Outbound

check

Request

check

Transactions

check

Streaming

check (client ack, local, XA)

Retries

error

MEPs

check

Default MEP

one-way, request-response

Maven Artifact

org.mule.transport:mule-transport-jms

Legend:

  • Transport - The name/protocol of the transport.

  • Docs - Links to the JavaDoc and SchemaDoc for the transport.

  • Inbound - Whether the transport can receive inbound events and can be used for an inbound endpoint.

  • Outbound - Whether the transport can produce outbound events and be used with an outbound endpoint.

  • Request - Whether this endpoint can be queried directly with a request call (via MuleClient or the EventContext).

  • Transactions - Whether transactions are supported by the transport. Transports that support transactions can be configured in either local or distributed two-phase commit (XA) transaction.

  • Streaming - Whether this transport can process messages that come in on an input stream. This allows for very efficient processing of large data. For more information, see Streaming.

  • Retry - Whether this transport supports retry policies. Note that all transports can be configured with Retry policies, but only the ones marked here are officially supported by MuleSoft

  • MEPs - Message Exchange Patterns supported by this transport.

  • Default MEP - The default MEP for endpoints that use this transport that do not explicitly configure a MEP.

  • Maven Artifact - The group name a artifact name for this transport in Maven.

Namespace and Syntax

XML namespace:

xmlns:jms "http://www.mulesoft.org/schema/mule/jms"

XML schema location:

http://www.mulesoft.org/schema/mule/jms/3.6/mule-jms.xsd

Connector syntax:

<jms:connector name="myConnector" specification="1.1" connectionFactory-ref="myConnectionFactory" username="myuser" password="mypass"/>

Endpoint syntax:

<jms:outbound-endpoint queue="my.queue"/>

<jms:inbound-endpoint topic="my.topic"/>

Considerations

In the point-to-point or queuing model, a sender posts messages to a particular queue and a receiver reads messages from the queue. Here, the sender knows the destination of the message and posts the message directly to the receiver’s queue. It is characterized by the following:

  • Only one consumer gets the message

  • The producer does not have to be running at the time the consumer consumes the message, nor does the consumer need to be running at the time the message is sent

  • Every message successfully processed is acknowledged by the consumer

The publish/subscribe model supports publishing messages to a particular message topic. Subscribers may register interest in receiving messages on a particular message topic. In this model, neither the publisher nor the subscriber know about each other. A good analogy for this is an anonymous bulletin board. The following are characteristics of this model:

  • Multiple consumers (or none) receive the message

  • There is a timing dependency between publishers and subscribers. The publisher has to create a message topic for clients to subscribe.

  • The subscriber has to remain continuously active to receive messages, unless it has established a durable subscription. In that case, messages published while the subscriber is not connected redistribute when it reconnects.

Features

  • Supports both versions of the JMS specification: 1.0.2b and 1.1

  • Supports queues and topics, durable or non-durable subscriptions

  • ConnectionFactory and Queues/Topics can be looked up via JNDI

  • Supports local (JMS), distributed (XA), and multi-resource transactions *Enterprise*

  • Tested with a variety of JMS providers

  • Vendor-specific configuration available for popular providers

WebSphere MQ - Enterprise-Only

Mule Enterprise includes an enhanced transport for WebSphereMQ when using WebSphereMQ as your JMS provider.

Usage

Declaring the Namespace

To use the JMS transport, you must first declare the JMS namespace in the header of your Mule configuration file. You can then configure the JMS connector and endpoints.

JMS Namespace

<mule ...cut...
   xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
   xsi:schemaLocation=" ...cut...
     http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd">

Configuring the Connector

There are several attributes available on the connector, most of which are optional. Refer to the schema documentation below for complete information.

Connector Attributes

<jms:connector name="myConnector"
     acknowledgementMode="DUPS_OK_ACKNOWLEDGE"
     clientId="myClient"
     durable="true"
     noLocal="true"
     persistentDelivery="true"
     maxRedelivery="5"
     cacheJmsSessions="true"
     eagerConsumer="false"
     specification="1.1"
     numberOfConsumers="7"
     username="myuser"
     password="mypass" />

Configuring the ConnectionFactory

One of the most important attributes is connectionFactory-ref. This is a reference to the ConnectionFactory object which creates new connections for your JMS provider. The object must implement the interface javax.jms.ConnectionFactory.

ConnectionFactory

<spring:bean name="connectionFactory" class="com.foo.FooConnectionFactory"/>

<jms:connector name="jmsConnector1" connectionFactory-ref="connectionFactory" />

Attributes that allow you to look up the ConnectionFactory from a JNDI Context:

ConnectionFactory from JNDI

<jms:connector name="jmsConnector"
    jndiInitialFactory="com.sun.jndi.ldap.LdapCtxFactory"
    jndiProviderUrl="ldap://localhost:10389/"
    jndiProviderProperties-ref="providerProperties"
    connectionFactoryJndiName="cn=ConnectionFactory,dc=example,dc=com" />

JMS Performance

For performance it is important to use the "Caching Connection Strategy" between your JMS Connector and the actual JMS ConnectionFactory implementation. For more information, see Caching Connection Factory below.

Configuring the Endpoints

Queues

<jms:inbound-endpoint queue="my.queue"/>
<jms:outbound-endpoint queue="my.queue"/>

Topics

<jms:inbound-endpoint topic="my.topic"/>
<jms:outbound-endpoint topic="my.topic"/>

By default, Mule’s subscription to a topic is non-durable (that is, it only receives messages while connected to the topic). You can make topic subscriptions durable by setting the durable attribute on the connector.

When using a durable subscription, the JMS server requires a durable name to identify each subscriber. By default, Mule generates the durable name in the format mule.<connector name>.<topic name>. If you want to specify the durable name yourself, you can do so using the durableName attribute on the endpoint.

Durable Topic

<jms:connector name="jmsTopicConnector" durable="true"/>
<jms:inbound-endpoint topic="some.topic" durableName="sub1" />
<jms:inbound-endpoint topic="some.topic" durableName="sub2" />
<jms:inbound-endpoint topic="some.topic" durableName="sub3" />

Number of Consumers

In the case of a topic, the number of consumers on the endpoint is set to one. You can override this by setting numberOfConcurrentTransactedReceivers or numberOfConsumers on the connector.

Transformers

The default transformers applied to JMS endpoints are as follows:

These automatically transform to/from the standard JMS message types:

javax.jms.TextMessage - java.lang.String
javax.jms.ObjectMessage - java.lang.Object
javax.jms.BytesMessage - byte[]
javax.jms.MapMessage - java.util.Map
javax.jms.StreamMessage - java.io.InputStream

Looking Up JMS Objects from JNDI

If you have configured a JNDI context on the connector, you can also look up queues/topics via JNDI using the jndiDestinations attribute. If a queue/topic cannot be found via JNDI, it’s created using the existing JMS session unless you also set the forceJndiDestinations attribute.

There are two different ways to configure the JNDI settings:

  1. Using connector properties (deprecated):

    <jms:connector name="jmsConnector"
        jndiInitialFactory="com.sun.jndi.ldap.LdapCtxFactory"
        jndiProviderUrl="ldap://localhost:10389/"
        connectionFactoryJndiName="cn=ConnectionFactory,dc=example,dc=com"
        jndiDestinations="true"
        forceJndiDestinations="true"/>
  2. Using a JndiNameResolver. A JndiNameResolver defines a strategy for lookup objects by name using JNDI. The strategy contains a lookup method that receives a name and returns the object associated to that name.

At the moment, there are two simple implementations of that interface:

  • SimpleJndiNameResolver: Uses a JNDI context instance to search for the names. That instance is maintained opened during the full lifecycle of the name resolver.

  • CachedJndiNameResolver: Uses a simple cache in order to store previously resolved names. A JNDI context instance is created for each request that is sent to the JNDI server and then the instance is freed. The cache can be cleaned up restarting the name resolver.

Default JNDI name resolver example: Define the name resolver using the default-jndi-name-resolver tag and then add the appropriate properties to it.

<jms:activemq-connector name="jmsConnector"
    jndiDestinations="true"
    connectionFactoryJndiName="ConnectionFactory">
    <jms:default-jndi-name-resolver
      jndiInitialFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
      jndiProviderUrl="vm://localhost?broker.persistent=false&amp;broker.useJmx=false"
      jndiProviderProperties-ref="providerProperties"/>
</jms:activemq-connector>

Custom JNDI name resolver example : Define the name resolver using the custom-jndi-name-resolver tag, then add the appropriate property values using the Spring’s property format.

<jms:activemq-connector name="jmsConnector"
    jndiDestinations="true"
    connectionFactoryJndiName="ConnectionFactory">
    <jms:custom-jndi-name-resolver
      class="org.mule.transport.jms.jndi.CachedJndiNameResolver">
        <spring:property name="jndiInitialFactory" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
        <spring:property name="jndiProviderUrl"
            value="vm://localhost?broker.persistent=false&amp;broker.useJmx=false"/>
        <spring:property name="jndiProviderProperties" ref="providerProperties"/>
    </jms:custom-jndi-name-resolver>
</jms:activemq-connector>

Changes in JmsConnector

There are some property changes in the JmsConnector definition. Some properties are now deprecated as they should be defined in a JndiNameResolver and then using that JndiNameResolver in the JmsConnector.

Deprecated properties in JmsConnector:

  • jndiContext

  • jndiInitialFactory

  • jndiProviderUrl

  • jndiProviderProperties-ref

Added property:

  • jndiNameResolver: Sets a proper JndiNameResolver. Can be set using the default-jndi-name-resolver or custom-jndi-name-resolver tags inside the JmsConnector definition.

JMS Selectors

You can set a JMS selector as a filter on an inbound endpoint. The JMS selector simply sets the filter expression on the JMS consumer.

JMS Selector

<jms:inbound-endpoint queue="important.queue">
    <jms:selector expression="JMSPriority=9"/>
</jms:inbound-endpoint>

JMS Header Properties

Once a JMS message is received by Mule, the standard JMS headers such as JMSCorrelationID and JMSRedelivered are made available as properties on the MuleMessage object.

To set the JMSCorrelationID, use a transformer such as:

<set-property propertyName="MULE_CORRELATION_ID" value="1234" />

This creates the Outbound property which is then mapped to the JMSCorrelationID header. This header is then able to be consumed by other non-Mule applications that are JMS compliant. See also: Disable Reply Message, which helps if you are setting the correlation ID and want to avoid automatic responses.

Retrieving JMS Headers

String corrId = (String) muleMessage.getProperty("JMSCorrelationID");
boolean redelivered =  muleMessage.getBooleanProperty("JMSRedelivered");

You can access any custom header properties on the message in the same way.

Configuring Transactional Polling

_*Enterprise*_

The Enterprise version of the JMS transport can be configured for transactional polling using the TransactedPollingJmsMessageReceiver.

Transactional Polling

<jms:connector ...cut...>
     <service-overrides transactedMessageReceiver="com.mulesoft.mule.transport.jms.TransactedPollingJmsMessageReceiver" />
</jms:connector>

<jms:inbound-endpoint queue="my.queue">
     <properties>
          <spring:entry key="pollingFrequency" value="5000" /> (1)
     </properties>
</jms:inbound-endpoint>
1 Each receiver polls with a 5 second interval

Disable Reply Message

When an incoming message has the replyTo property set, you may wish to disable the automatic reply message on a flow starting with a one-way JMS inbound endpoint. To do so, set the following variable anywhere in your flow to prevent Mule from automatically sending a response.

<set-variable variableName="MULE_REPLYTO_STOP" value="true" doc:name="Variable"/>

JMS Session Pooling

As of 3.5.0, you can use JMS session pooling to obtain better performance when under a high load of traffic.

To implement this, you must:

  1. Configure a bean for the JMS connection factory

    <spring:bean name="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
       <spring:property name="brokerURL" value="..."/>
    </spring:bean>
  2. Create a caching-connection-factory pointing to the previous connection factory bean:

    <jms:caching-connection-factory name="cachingConnectionFactory" connectionFactory-ref="connectionFactory" cacheProducers="false" sessionCacheSize="100"/>
  3. Inside a flow, create a JMS connector that references the Caching Connection Factory:

    <jms:activemq-connector name="JMS"
     connectionFactory-ref="cachingConnectionFactory"
     specification="1.1"
     validateConnections="true"
     maxRedelivery="-1"
     numberOfConsumers="4"/>

Implementing Message Groups

Message groups provide ordering of related messages, load balancing across multiple consumers, and auto failover to other consumers if JVM goes down. Messages in a group deliver to the same consumer as long as it’s available but switch to another consumer if the first goes away.

You can implement a message group by setting JMSGroupID property on the client producer (outbound endpoint) before sending it off. By default, all messages deliver in the same order as they arrive, but it’s also possible to set the JMSXGroupSec property to control in which order different messages should be delivered.

An example in a flow is:

<jms:outbound-endpoint queue="orders.car" connector-ref="amqConnector">
    <message-properties-transformer scope="outbound">
        <add-message-property key="JMSXGroupID" value="#[xpath://type]"/>
    </message-properties-transformer>
...

Modifying Message Priorities

To modify the priority of a JMS message, set the priority key as the name of the property instead of using the JMSpriority key:

<message-properties-transformer doc:name="Message Properties">
    <add-message-property key="priority" value="6"/>
</message-properties-transformer>

This won’t work:

<message-properties-transformer doc:name="Message Properties">
    <add-message-property key="JMSPriority" value="6"/>
</message-properties-transformer>

Example Configurations

Example Configuration

<mule ...cut...
  xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
  xsi:schemaLocation="...cut...
    http://www.mulesoft.org/schema/mule/jms
    http://www.mulesoft.org/schema/mule/jms/3.6/mule-jms.xsd"> (1)

    <spring:bean name="connectionFactory" class="com.foo.FooConnectionFactory"/>

    <jms:connector name="jmsConnector" connectionFactory-ref="connectionFactory" username="myuser" password="mypass" />

    <flow name="MyFlow">
        <jms:inbound-endpoint queue="in" />
        <component class="com.foo.MyComponent" />
        <jms:outbound-endpoint queue="out" />
    </flow>
</mule>
1 Import the JMS schema namespace.

Example Configuration with Transactions

<mule ...cut...
  xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
  xsi:schemaLocation="...cut...
    http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/3.6/mule-jms.xsd">

    <spring:bean name="connectionFactory" class="com.foo.FooConnectionFactory"/>

    <jms:connector name="jmsConnector" connectionFactory-ref="connectionFactory" username="myuser" password="mypass" />

    <flow name="MyFlow">
        <jms:inbound-endpoint queue="in">
            <jms:transaction action="ALWAYS_BEGIN" /> (1)
        </jms:inbound-endpoint>
        <component class="com.foo.MyComponent" />
        <jms:outbound-endpoint queue="out">
            <jms:transaction action="ALWAYS_JOIN" /> (1)
        </jms:outbound-endpoint>
    </flow>
</mule>
1 Local JMS transaction

Example Configuration with Exception Strategy

<mule ...cut...
  xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
  xsi:schemaLocation="...cut...
    http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/3.6/mule-jms.xsd">

    <spring:bean name="connectionFactory" class="com.foo.FooConnectionFactory"/>

    <jms:connector name="jmsConnector" connectionFactory-ref="connectionFactory" username="myuser" password="mypass" />

    <flow name="MyFlow">
        <jms:inbound-endpoint queue="in">
            <jms:transaction action="ALWAYS_BEGIN" />
        </jms:inbound-endpoint>
        <component class="com.foo.MyComponent" />
        <jms:outbound-endpoint queue="out">
            <jms:transaction action="ALWAYS_JOIN" />
        </jms:outbound-endpoint>
        <default-exception-strategy>
            <commit-transaction exception-pattern="com.foo.ExpectedExceptionType"/> (1)
            <jms:outbound-endpoint queue="dead.letter"> (2)
                <jms:transaction action="JOIN_IF_POSSIBLE" />
            </jms:outbound-endpoint>
        </default-exception-strategy>
    </flow>
</mule>
1 Set exception-pattern="*" to catch all exception types.
2 Implements a dead letter queue for erroneous messages.

Vendor-Specific Configuration

*Enterprise*

Mule Enterprise includes an enhanced transport for WebSphereMQ which is recommended if you are using WebSphereMQ as your JMS provider.

ActiveMQ is also widely-used with Mule and has simplified configuration.

Information for configuring other JMS providers can be found here. Beware that some of this information may be out-of-date.

Reference

Configuration Reference

JMS Transport

The JMS transport provides support for sending messages via JMS queues.

Connector

The connector element configures a generic connector for sending and receiving messages over JMS queues.

Attributes of <connector…​>

Name Description

connectionFactory-ref

Reference to the connection factory, which is required for non-vendor JMS configurations.

Type: string
Required: no
Default: none

redeliveryHandlerFactory-ref

Reference to the redelivery handler.

Type: string
Required: no
Default: none

acknowledgementMode

The acknowledgement mode to use: AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, or DUPS_OK_ACKNOWLEDGE.

Type: enumeration
Required: no
Default: AUTO_ACKNOWLEDGE

clientId

The ID of the JMS client.

Type: string
Required: no
Default: none

durable

Whether to make all topic subscribers durable.

Type: boolean
Required: no
Default: none

noLocal

If set to true, a subscriber cannot receive messages that were published by its own connection.

Type: boolean
Required: no
Default: none

persistentDelivery

If set to true, the JMS provider logs the message to stable storage as it is sent so that it can be recovered if delivery is unsuccessful. A client marks a message as persistent if it feels that the application has problems if the message is lost in transit. A client marks a message as non-persistent if an occasional lost message is tolerable. Clients use delivery mode to tell a JMS provider how to balance message transport reliability/throughput. Delivery mode only covers the transport of the message to its destination. Retention of a message at the destination until its receipt is acknowledged is not guaranteed by a PERSISTENT delivery mode. Clients should assume that message retention policies are set administratively. Message retention policy governs the reliability of message delivery from destination to message consumer. For example, if a client’s message storage space is exhausted, some messages as defined by a site specific message retention policy may be dropped. A message is guaranteed to be delivered once-and-only-once by a JMS Provider if the delivery mode of the message is persistent and if the destination has a sufficient message retention policy.

Type: boolean
Required: no
Default: none

honorQosHeaders

If set to true, the message’s QoS headers are honored. If false (the default), the connector settings override the message headers.

Type: boolean
Required: no
Default: none

maxRedelivery

The maximum number of times to try to redeliver a message. Use -1 to accept messages with any redelivery count.

Type: integer
Required: no
Default: none

cacheJmsSessions

Whether to cache and re-use the JMS session and producer object instead of recreating them for each request. The default behavior is to cache JMS Sessions and Producers (previous to 3.6, the default behavior was to not cache them). NOTE: This is NOT supported with XA transactions or JMS 1.0.2b.

Type: boolean
Required: no
Default: true

eagerConsumer

Whether to create a consumer right when the connection is created instead of using lazy instantiation in the poll loop.

Type: boolean
Required: no
Default: none

specification

The JMS specification to use: 1.0.2b (the default) or 1.1.

Type: enumeration
Required: no
Default: 1.0.2b

username

The user name for the connection.

Type: string
Required: no
Default: none

password

The password for the connection.

Type: string
Required: no
Default: none

numberOfConsumers

The number of concurrent consumers use to receive JMS messages. (Note: If you use this attribute, do not configure the 'numberOfConcurrentTransactedReceivers', which has the same effect.)

Type: integer
Required: no
Default: none

jndiInitialFactory

The initial factory class to use when connecting to JNDI. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

jndiProviderUrl

The URL to use when connecting to JNDI. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

jndiProviderProperties-ref

Reference to a Map that contains additional provider properties. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

connectionFactoryJndiName

The name to use when looking up the connection factory from JNDI.

Type: string
Required: no
Default: none

jndiDestinations

Set this attribute to true if you want to look up queues or topics from JNDI instead of creating them from the session.

Type: boolean
Required: no
Default: none

forceJndiDestinations

If set to true, Mule fails when a topic or queue cannot be retrieved from JNDI. If set to false, Mule creates a topic or queue from the JMS session if the JNDI lookup fails.

Type: boolean
Required: no
Default: none

disableTemporaryReplyToDestinations

If this is set to false (the default), when Mule performs request/response calls a temporary destination automatically is set up to receive a response from the remote JMS call.

Type: boolean
Required: no
Default: false

embeddedMode

Some application servers, like WebSphere AS, don’t allow certain methods to be called on JMS objects, effectively limiting available features. Embedded mode tells Mule to avoid those whenever possible. Default is false.

Type: boolean
Required: no
Default: false

Child Elements of <connector…​>

Name Cardinality Description

abstract-jndi-name-resolver

0..1

A placeholder for jndi-name-resolver strategy elements.

Inbound Endpoint

The inbound-endpoint element configures an endpoint on which JMS messages are received.

Attributes of <inbound-endpoint…​>

Name Description

durableName

(As of 2.2.2) Allows the name for the durable topic subscription to be specified.

Type: string
Required: no
Default: none

queue

The queue name. This attribute cannot be used with the topic attribute (the two are exclusive).

Type: string
Required: no
Default: none

topic

The topic name. The "topic:" prefix is added automatically. This attribute cannot be used with the queue attribute (the two are exclusive).

Type: string
Required: no
Default: none

disableTemporaryReplyToDestinations

If this is set to false (the default), when Mule performs request/response calls a temporary destination that’s set automatically to receive a response from the remote JMS call.

Type: boolean
Required: no
Default: none

Child Elements of <inbound-endpoint…​>

Name Cardinality Description

mule:abstract-xa-transaction

0..1

-

selector

0..1

-

Outbound endpoint

The inbound-endpoint element configures an endpoint to which JMS messages are sent.

Attributes of <outbound-endpoint…​>

Name Description

queue

The queue name. This attribute cannot be used with the topic attribute (the two are exclusive).

Type: string
Required: no
Default: none

topic

The topic name. The "topic:" prefix are added automatically. This attribute cannot be used with the queue attribute (the two are exclusive).

Type: string
Required: no
Default: none

disableTemporaryReplyToDestinations

If this is set to false (the default), when Mule performs request/response calls a temporary destination that is automatically set to receive a response from the remote JMS call.

Type: boolean
Required: no
Default: none

Child Elements of <outbound-endpoint…​>

Name Cardinality Description

mule:abstract-xa-transaction

0..1

-

selector

0..1

-

Endpoint

The endpoint element configures a global JMS endpoint definition.

Attributes of <endpoint…​>

Name Description

queue

The queue name. This attribute cannot be used with the topic attribute (the two are exclusive).

Type: string
Required: no
Default: none

topic

The topic name. The "topic:" prefix is added automatically. This attribute cannot be used with the queue attribute (the two are exclusive).

Type: string
Required: no
Default: none

disableTemporaryReplyToDestinations

If this is set to false (the default), when Mule performs request/response calls a temporary destination that’s set automatically to receive a response from the remote JMS call.

Type: boolean
Required: no
Default: none

Child Elements of <endpoint…​>

Name Cardinality Description

mule:abstract-xa-transaction

0..1

-

selector

0..1

-

Transformers

These are transformers specific to this transport. Note that these are added automatically to the Mule registry at start up. When doing automatic transformations these are included when searching for the correct transformers.

Name Description

jmsmessage-to-object-transformer

The jmsmessage-to-object-transformer element configures a transformer that converts a JMS message into an object by extracting the message payload.

object-to-jmsmessage-transformer

The object-to-jmsmessage-transformer element configures a transformer that converts an object into one of five types of JMS messages, depending on the object passed in: java.lang.String → javax.jms.TextMessage, byte[] → javax.jms.BytesMessage, java.util.Map (primitive types) → javax.jms.MapMessage, java.io.InputStream (or java.util.List of primitive types) → javax.jms.StreamMessage, and java.lang.Serializable including java.util.Map, java.util.List, and java.util.Set objects that contain serializable objects (including primitives) → javax.jms.ObjectMessage.

Filters

Filters can be used to control which data is allowed to continue in the flow.

Name Description

property-filter

The property-filter element configures a filter that allows you to filter messages based on a JMS property.

Custom Connector

The custom-connector element configures a custom connector for sending and receiving messages over JMS queues.

ActiveMQ Connector

The activemq-connector element configures an ActiveMQ version of the JMS connector.

Attributes of <activemq-connector…​>

Name Description

connectionFactory-ref

Optional reference to the connection factory. A default connection factory is provided for vendor-specific JMS configurations.

Type: string
Required: no
Default: none

redeliveryHandlerFactory-ref

Reference to the redelivery handler.

Type: string
Required: no
Default: none

acknowledgementMode

The acknowledgement mode to use: AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, or DUPS_OK_ACKNOWLEDGE.

Type: enumeration
Required: no
Default: AUTO_ACKNOWLEDGE

clientId

The ID of the JMS client.

Type: string
Required: no
Default: none

durable

Whether to make all topic subscribers durable.

Type: boolean
Required: no
Default: none

noLocal

If set to true, a subscriber does not receive messages that were published by its own connection.

Type: boolean
Required: no
Default: none

persistentDelivery

If set to true, the JMS provider logs the message to stable storage as it is sent so that it can be recovered if delivery is unsuccessful. A client marks a message as persistent if it feels that the application has problems if the message is lost in transit. A client marks a message as non-persistent if an occasional lost message is tolerable. Clients use delivery mode to tell a JMS provider how to balance message transport reliability/throughput. Delivery mode only covers the transport of the message to its destination. Retention of a message at the destination until its receipt is acknowledged is not guaranteed by a PERSISTENT delivery mode. Clients should assume that message retention policies are set administratively. Message retention policy governs the reliability of message delivery from destination to message consumer. For example, if a client’s message storage space is exhausted, some messages as defined by a site specific message retention policy may be dropped. A message is guaranteed to be delivered once-and-only-once by a JMS Provider if the delivery mode of the message is persistent and if the destination has a sufficient message retention policy.

Type: boolean
Required: no
Default: none

honorQosHeaders

If set to true, the message’s QoS headers are honored. If false (the default), the connector settings override the message headers.

Type: boolean
Required: no
Default: none

maxRedelivery

The maximum number of times to try to redeliver a message. Use -1 to accept messages with any redelivery count.

Type: integer
Required: no
Default: none

cacheJmsSessions

Whether to cache and re-use the JMS session and producer object instead of recreating them for each request. The default behavior is to cache JMS Sessions and Producers (previous to 3.6, the default behavior was to not cache them). NOTE: This is NOT supported with XA transactions or JMS 1.0.2b.

Type: boolean
Required: no
Default: true

eagerConsumer

Whether to create a consumer right when the connection is created instead of using lazy instantiation in the poll loop.

Type: boolean
Required: no
Default: none

specification

The JMS specification to use: 1.0.2b (the default) or 1.1.

Type: enumeration
Required: no
Default: 1.0.2b

username

The user name for the connection.

Type: string
Required: no
Default: none

password

The password for the connection.

Type: string
Required: no
Default: none

numberOfConsumers

The number of concurrent consumers that are used to receive JMS messages. (Note: If you use this attribute, you should not configure the 'numberOfConcurrentTransactedReceivers', which has the same effect.)

Type: integer
Required: no
Default: none

jndiInitialFactory

The initial factory class to use when connecting to JNDI. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

jndiProviderUrl

The URL to use when connecting to JNDI. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

jndiProviderProperties-ref

Reference to a Map that contains additional provider properties. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

connectionFactoryJndiName

he name to use when looking up the connection factory from JNDI.

Type: string
Required: no
Default: none

jndiDestinations

Set this attribute to true if you want to look up queues or topics from JNDI instead of creating them from the session.

Type: boolean
Required: no
Default: none

forceJndiDestinations

If set to true, Mule fails when a topic or queue cannot be retrieved from JNDI. If set to false, Mule creates a topic or queue from the JMS session if the JNDI lookup fails.

Type: boolean
Required: no
Default: none

disableTemporaryReplyToDestinations

If this is set to false (the default), when Mule performs request/response calls a temporary destination that is automatically set to receive a response from the remote JMS call.

Type: boolean
Required: no
Default: none

embeddedMode

Some application servers, like WebSphere AS, don’t allow certain methods to be called on JMS objects, effectively limiting available features. Embedded mode tells Mule to avoid those whenever possible. Default is false.

Type: boolean
Required: no
Default: false

brokerURL

The URL used to connect to the JMS server. If not set, the default is vm://localhost?broker.persistent=false&broker.useJmx=false.

Type: string
Required: no
Default: none

Child Elements of <activemq-connector…​>

Name Cardinality Description

abstract-jndi-name-resolver

0..1

A placeholder for jndi-name-resolver strategy elements.

Activemq xa connector

The activemq-xa-connector element configures an ActiveMQ version of the JMS connector with XA transaction support.

Attributes of <activemq-xa-connector…​>

Name Description

connectionFactory-ref

Optional reference to the connection factory. A default connection factory is provided for vendor-specific JMS configurations.

Type: string
Required: no
Default: none

redeliveryHandlerFactory-ref

Reference to the redelivery handler.

Type: string
Required: no
Default: none

acknowledgementMode

The acknowledgement mode to use: AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, or DUPS_OK_ACKNOWLEDGE.

Type: enumeration
Required: no
Default: AUTO_ACKNOWLEDGE

clientId

The ID of the JMS client.

Type: string
Required: no
Default: none

durable

Whether to make all topic subscribers durable.

Type: boolean
Required: no
Default: none

noLocal

If set to true, a subscriber does not receive messages that were published by its own connection.

Type: boolean
Required: no
Default: none

persistentDelivery

If set to true, the JMS provider logs the message to stable storage as it is sent so that it can be recovered if delivery is unsuccessful. A client marks a message as persistent if it feels that the application has problems if the message is lost in transit. A client marks a message as non-persistent if an occasional lost message is tolerable. Clients use delivery mode to tell a JMS provider how to balance message transport reliability/throughput. Delivery mode only covers the transport of the message to its destination. Retention of a message at the destination until its receipt is acknowledged is not guaranteed by a PERSISTENT delivery mode. Clients should assume that message retention policies are set administratively. Message retention policy governs the reliability of message delivery from destination to message consumer. For example, if a client’s message storage space is exhausted, some messages as defined by a site specific message retention policy may be dropped. A message is guaranteed to be delivered once-and-only-once by a JMS Provider if the delivery mode of the message is persistent and if the destination has a sufficient message retention policy.

Type: boolean
Required: no
Default: none

honorQosHeaders

If set to true, the message’s QoS headers are honored. If false (the default), the connector settings override the message headers.

Type: boolean
Required: no
Default: none

maxRedelivery

The maximum number of times to try to redeliver a message. Use -1 to accept messages with any redelivery count.

Type: integer
Required: no
Default: none

cacheJmsSessions

Whether to cache and re-use the JMS session and producer object instead of recreating them for each request. The default behavior is to cache JMS Sessions and Producers (previous to 3.6, the default behavior was to not cache them). NOTE: This is NOT supported with XA transactions or JMS 1.0.2b.

Type: boolean
Required: no
Default: true

eagerConsumer

Whether to create a consumer right when the connection is created instead of using lazy instantiation in the poll loop.

Type: boolean
Required: no
Default: none

specification

The JMS specification to use: 1.0.2b (the default) or 1.1.

Type: enumeration
Required: no
Default: 1.0.2b

username

The user name for the connection.

Type: string
Required: no
Default: none

password

The password for the connection.

Type: string
Required: no
Default: none

numberOfConsumers

The number of concurrent consumers that are used to receive JMS messages. (Note: If you use this attribute, you should not configure the 'numberOfConcurrentTransactedReceivers', which has the same effect.)

Type: integer
Required: no
Default: none

jndiInitialFactory

The initial factory class to use when connecting to JNDI. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

jndiProviderUrl

The URL to use when connecting to JNDI. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

jndiProviderProperties-ref

Reference to a Map that contains additional provider properties. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

connectionFactoryJndiName

The name to use when looking up the connection factory from JNDI.

Type: string
Required: no
Default: none

jndiDestinations

Set this attribute to true if you want to look up queues or topics from JNDI instead of creating them from the session.

Type: boolean
Required: no
Default: none

forceJndiDestinations

If set to true, Mule fails when a topic or queue cannot be retrieved from JNDI. If set to false, Mule creates a topic or queue from the JMS session if the JNDI lookup fails.

Type: boolean
Required: no
Default: none

disableTemporaryReplyToDestinations

If this is set to false (the default), when Mule performs request/response calls a temporary destination that is automatically set to receive a response from the remote JMS call.

Type: boolean
Required: no
Default: none

embeddedMode

Some application servers, like WebSphere AS, don’t allow certain methods to be called on JMS objects, effectively limiting available features. Embedded mode tells Mule to avoid those whenever possible. Default is false.

Type: boolean
Required: no
Default: false

brokerURL

The URL used to connect to the JMS server. If not set, the default is vm://localhost?broker.persistent=false&broker.useJmx=false.

Type: string
Required: no
Default: none

Child Elements of <activemq-xa-connector…​>

Name Cardinality Description

abstract-jndi-name-resolver

0..1

A placeholder for jndi-name-resolver strategy elements.

Mulemq connector

The mulemq-connector element configures a MuleMQ version of the JMS connector.

Attributes of <mulemq-connector…​>

Name Description

connectionFactory-ref

Optional reference to the connection factory. A default connection factory is provided for vendor-specific JMS configurations.

Type: string
Required: no
Default: none

redeliveryHandlerFactory-ref

Reference to the redelivery handler.

Type: string
Required: no
Default: none

acknowledgementMode

The acknowledgement mode to use: AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, or DUPS_OK_ACKNOWLEDGE.

Type: enumeration
Required: no
Default: AUTO_ACKNOWLEDGE

clientId

The ID of the JMS client.

Type: string
Required: no
Default: none

durable

Whether to make all topic subscribers durable.

Type: boolean
Required: no
Default: none

noLocal

If set to true, a subscriber does not receive messages that were published by its own connection.

Type: boolean
Required: no
Default: none

persistentDelivery

If set to true, the JMS provider logs the message to stable storage as it is sent so that it can be recovered if delivery is unsuccessful. A client marks a message as persistent if it feels that the application has problems if the message is lost in transit. A client marks a message as non-persistent if an occasional lost message is tolerable. Clients use delivery mode to tell a JMS provider how to balance message transport reliability/throughput. Delivery mode only covers the transport of the message to its destination. Retention of a message at the destination until its receipt is acknowledged is not guaranteed by a PERSISTENT delivery mode. Clients should assume that message retention policies are set administratively. Message retention policy governs the reliability of message delivery from destination to message consumer. For example, if a client’s message storage space is exhausted, some messages as defined by a site specific message retention policy may be dropped. A message is guaranteed to be delivered once-and-only-once by a JMS Provider if the delivery mode of the message is persistent and if the destination has a sufficient message retention policy.

Type: boolean
Required: no
Default: none

honorQosHeaders

If set to true, the message’s QoS headers are honored. If false (the default), the connector settings override the message headers.

Type: boolean
Required: no
Default: none

maxRedelivery

The maximum number of times to try to redeliver a message. Use -1 to accept messages with any redelivery count.

Type: integer
Required: no
Default: none

cacheJmsSessions

Whether to cache and re-use the JMS session and producer object instead of recreating them for each request. The default behavior is to cache JMS Sessions and Producers (previous to 3.6, the default behavior was to not cache them). NOTE: This is NOT supported with XA transactions or JMS 1.0.2b.

Type: boolean
Required: no
Default: true

eagerConsumer

Whether to create a consumer right when the connection is created instead of using lazy instantiation in the poll loop.

Type: boolean
Required: no
Default: none

specification

The JMS specification to use: 1.0.2b (the default) or 1.1.

Type: enumeration
Required: no
Default: 1.0.2b

username

he user name for the connection.

Type: string
Required: no
Default: none

password

The password for the connection.

Type: string
Required: no
Default: none

numberOfConsumers

The number of concurrent consumers that are used to receive JMS messages. (Note: If you use this attribute, you should not configure the 'numberOfConcurrentTransactedReceivers', which has the same effect.)

Type: integer
Required: no
Default: none

jndiInitialFactory

The initial factory class to use when connecting to JNDI. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

jndiProviderUrl

The URL to use when connecting to JNDI. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

jndiProviderProperties-ref

Reference to a Map that contains additional provider properties. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

connectionFactoryJndiName

The name to use when looking up the connection factory from JNDI.

Type: string
Required: no
Default: none

jndiDestinations

Set this attribute to true if you want to look up queues or topics from JNDI instead of creating them from the session.

Type: boolean
Required: no
Default: none

forceJndiDestinations

If set to true, Mule fails when a topic or queue cannot be retrieved from JNDI. If set to false, Mule creates a topic or queue from the JMS session if the JNDI lookup fails.

Type: boolean
Required: no
Default: none

disableTemporaryReplyToDestinations

If this is set to false (the default), when Mule performs request/response calls a temporary destination that is automatically set to receive a response from the remote JMS call.

Type: boolean
Required: no
Default: none

embeddedMode

Some application servers, like WebSphere AS, don’t allow certain methods to be called on JMS objects, effectively limiting available features. Embedded mode tells Mule to avoid those whenever possible. Default is false.

Type: boolean
Required: no
Default: false

brokerURL

The URL used to connect to the JMS server. If not set, the default is nsp://localhost:9000. When connecting to a cluster separate urls with a comma.

Type: string
Required: no
Default: none

bufferOutput

Specifies the type of write handler the client uses to send events to the realm. This can be either standard, direct or queued. Unless specified, standard is used. For better latencies use direct, however, this impacts CPU since each write is not buffered but flushed directly. The queued handler improves CPU and may give better overall throughput since there is some buffering between client and server. The best of both options is the standard, which attempts to write directly but backs off and buffers the IO flushes when throughput increases and impacts CPU.

Type: string
Required: no
Default: queued

syncWrites

Sets whether each write to the store also calls sync on the file system to ensure all data is written to the disk, default is false.

Type: boolean
Required: no
Default: false

syncBatchSize

Sets the size of the write sync batch, default is 50, range is 1 to Integer.MAX_VALUE.

Type: integer
Required: no
Default: 50

syncTime

Sets the time interval between sync batches, default is 20 milliseconds, range is 1 to Integer.MAX_VALUE.

Type: integer
Required: no
Default: 20

globalStoreCapacity

Sets that the default channel/queue capacity setting which prevents publishing of further events once topic or queue is full, default is 5000, valid range is 1 to Integer.MAX_VALUE.

Type: integer
Required: no
Default: 5000

maxUnackedSize

Specifies the maximum number of unacknowledged events a connection keep sin memory before beginning to remove the oldest, default is 100, range is 1 to Integer.MAX_VALUE.

Type: integer
Required: no
Default: 100

useJMSEngine

All JMS Topics require this setting to be true, however, if you wish to use different channel types with different fanout engines (in MULEMQ+ only), this can be set to false.

Type: boolean
Required: no
Default: true

queueWindowSize

When using queues, this specifies the number of messages that the server sends in each block between acknowledgments, default is 100, range is 1 to Integer.MAX_VALUE.

Type: integer
Required: no
Default: 100

autoAckCount

When auto acknowledgment mode is selected, rather than ack each event, each nth event is acknowledged, default is 50, range is 1 to Integer.MAX_VALUE.

Type: integer
Required: no
Default: 50

enableSharedDurable

Allows more than 1 durable subscriber on a topic sharing the same name, with only 1 consuming the events. When the first durable disconnects, the second takes over and so on. Default is false.

Type: boolean
Required: no
Default: false

randomiseRNames

With multiple RNAMEs, the ability to randomize the RNAMEs is useful for load balancing between cluster nodes.

Type: boolean
Required: no
Default: true

messageThreadPoolSize

Indicates the maximum number of threads each connection uses to deliver asynchronous events, default is 30, range is 1 to Integer.MAX_VALUE.

Type: integer
Required: no
Default: 30

discOnClusterFailure

Indicates whether the client connection is disconnected when the cluster fails, which causes automatic reconnect to occur, default is true.

Type: boolean
Required: no
Default: true

initialRetryCount

The maximum number of attempts a connection tries to connect to a realm on startup, default is 2, 0 is infinite, range is Integer.MIN_VALUE to Integer.MAX_VALUE.

Type: integer
Required: no
Default: 2

muleMqMaxRedelivery

This indicates the size of the map of redelivered events to store for each consumer, once this limit is reached the oldest is removed, default is 100, range is 1 to 100.

Type: integer
Required: no
Default: 100

retryCommit

If a transacted session commit fails, if this is true, the commit is retried until either it succeeds or fails with a transaction timeout, default is false.

Type: boolean
Required: no
Default: false

enableMultiplexedConnections

f this is true, the session is multiplexed on a single connection else a new socket is created for each session, default is false.

Type: boolean
Required: no
Default: false

Child Elements of <mulemq-connector…​>

Name Cardinality Description

abstract-jndi-name-resolver

0..1

A placeholder for jndi-name-resolver strategy elements.

MuleMQ XA Connector

The mulemq-xa-connector element configures a MuleMQ version of the JMS XA connector.

Attributes of <mulemq-xa-connector…​>

Name Description

connectionFactory-ref

Optional reference to the connection factory. A default connection factory is provided for vendor-specific JMS configurations.

Type: string
Required: no
Default: none

redeliveryHandlerFactory-ref

Reference to the redelivery handler.

Type: string
Required: no
Default: none

acknowledgementMode

The acknowledgement mode to use: AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, or DUPS_OK_ACKNOWLEDGE.

Type: enumeration
Required: no
Default: AUTO_ACKNOWLEDGE

clientId

The ID of the JMS client.

Type: string
Required: no
Default: none

durable

Whether to make all topic subscribers durable.

Type: boolean
Required: no
Default: none

noLocal

If set to true, a subscriber does not receive messages that were published by its own connection.

Type: boolean
Required: no
Default: none

persistentDelivery

If set to true, the JMS provider logs the message to stable storage as it is sent so that it can be recovered if delivery is unsuccessful. A client marks a message as persistent if it feels that the application has problems if the message is lost in transit. A client marks a message as non-persistent if an occasional lost message is tolerable. Clients use delivery mode to tell a JMS provider how to balance message transport reliability/throughput. Delivery mode only covers the transport of the message to its destination. Retention of a message at the destination until its receipt is acknowledged is not guaranteed by a PERSISTENT delivery mode. Clients should assume that message retention policies are set administratively. Message retention policy governs the reliability of message delivery from destination to message consumer. For example, if a client’s message storage space is exhausted, some messages as defined by a site specific message retention policy may be dropped. A message is guaranteed to be delivered once-and-only-once by a JMS Provider if the delivery mode of the message is persistent and if the destination has a sufficient message retention policy.

Type: boolean
Required: no
Default: none

honorQosHeaders

If set to true, the message’s QoS headers are honored. If false (the default), the connector settings override the message headers.

Type: boolean
Required: no
Default: none

maxRedelivery

The maximum number of times to try to redeliver a message. Use -1 to accept messages with any redelivery count.

Type: integer
Required: no
Default: none

cacheJmsSessions

Whether to cache and re-use the JMS session and producer object instead of recreating them for each request. The default behavior is to cache JMS Sessions and Producers (previous to 3.6, the default behavior was to not cache them). NOTE: This is NOT supported with XA transactions or JMS 1.0.2b.

Type: boolean
Required: no
Default: true

eagerConsumer

Whether to create a consumer right when the connection is created instead of using lazy instantiation in the poll loop.

Type: boolean
Required: no
Default: none

specification

The JMS specification to use: 1.0.2b (the default) or 1.1

Type: enumeration
Required: no
Default: 1.0.2b

username

The user name for the connection.

Type: string
Required: no
Default: none

password

The password for the connection.

Type: string
Required: no
Default: none

numberOfConsumers

The number of concurrent consumers that are used to receive JMS messages. (Note: If you use this attribute, you should not configure the 'numberOfConcurrentTransactedReceivers', which has the same effect.)

Type: integer
Required: no
Default: none

jndiInitialFactory

The initial factory class to use when connecting to JNDI. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

jndiProviderUrl

The URL to use when connecting to JNDI. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

jndiProviderProperties-ref

Reference to a Map that contains additional provider properties. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

connectionFactoryJndiName

The name to use when looking up the connection factory from JNDI.

Type: string
Required: no
Default: none

jndiDestinations

Set this attribute to true if you want to look up queues or topics from JNDI instead of creating them from the session.

Type: boolean
Required: no
Default: none

forceJndiDestinations

If set to true, Mule fails when a topic or queue cannot be retrieved from JNDI. If set to false, Mule creates a topic or queue from the JMS session if the JNDI lookup fails.

Type: boolean
Required: no
Default: none

disableTemporaryReplyToDestinations

If this is set to false (the default), when Mule performs request/response calls a temporary destination automatically is set to receive a response from the remote JMS call.

Type: boolean
Required: no
Default: none

embeddedMode

Some application servers, like WebSphere AS, don’t allow certain methods to be called on JMS objects, effectively limiting available features. Embedded mode tells Mule to avoid those whenever possible. Default is false.

Type: boolean
Required: no
Default: false

brokerURL

The URL used to connect to the JMS server. If not set, the default is nsp://localhost:9000. When connecting to a cluster separate urls with a comma.

Type: string
Required: no
Default: none

bufferOutput

Specifies the type of write handler the client uses to send events to the realm. This can be either standard, direct, or queued. Unless specified, standard is used. For better latencies use direct, however, this impacts CPU since each write is not buffered but flushed directly. The queued handler improves CPU and may gives better overall throughput since there is some buffering between client and server. The best of both options is standard, which attempts to write directly but backs off and buffers the I/O flushes when throughput increases and impacts CPU.

Type: string
Required: no
Default: queued

syncWrites

Sets whether each write to the store calls sync on the file system to ensure all data is written to the disk, default is false.

Type: boolean
Required: no
Default: false

syncBatchSize

Sets the size of the write sync batch, default is 50, range is 1 to Integer.MAX_VALUE.

Type: integer
Required: no
Default: 50

syncTime

Sets the time interval between sync batches, default is 20 milliseconds, range is 1 to Integer.MAX_VALUE.

Type: integer
Required: no
Default: 20

globalStoreCapacity

Sets that the default channel/queue capacity setting which prevents publishing of further events once topic or queue is full, default is 5000, valid range is 1 to Integer.MAX_VALUE.

Type: integer
Required: no
Default: 5000

maxUnackedSize

Specifies the maximum number of unacknowledged events a connection keeps in memory before beginning to remove the oldest, default is 100, range is 1 to Integer.MAX_VALUE.

Type: integer
Required: no
Default: 100

useJMSEngine

All JMS Topics require this setting to be true, however, if you wish to use different channel types with different fanout engines (in MULEMQ+ only), this can be set to false.

Type: boolean
Required: no
Default: true

queueWindowSize

When using queues, this specifies the number of messages that the server sends in each block between acknowledgments, default is 100, range is 1 to Integer.MAX_VALUE.

Type: integer
Required: no
Default: 100

autoAckCount

When auto acknowledgment mode is selected, rather than ack each event, each nth event is acknowledged, default is 50, range is 1 to Integer.MAX_VALUE.

Type: integer
Required: no
Default: 50

enableSharedDurable

Allows more than 1 durable subscriber on a topic sharing the same name, with only 1 consuming the events. When the first durable disconnects, the second takes over and so on. Default is false.

Type: boolean
Required: no
Default: false

randomiseRNames

With multiple RNAMEs, the ability to randomize the RNAMEs is useful for load balancing between cluster nodes.

Type: boolean
Required: no
Default: true

messageThreadPoolSize

Indicates the maximum number of threads each connection uses to deliver asynchronous events, default is 30, range is 1 to Integer.MAX_VALUE

Type: integer
Required: no
Default: 30

discOnClusterFailure

Indicates whether the client connection is disconnected when the cluster fails, which causes automatic reconnect to occur, default is true.

Type: boolean
Required: no
Default: true

initialRetryCount

The maximum number of attempts a connection tries to connect to a realm on startup, default is 2, 0 is infinite, range is Integer.MIN_VALUE to Integer.MAX_VALUE

Type: integer
Required: no
Default: 2

muleMqMaxRedelivery

This indicates the size of the map of redelivered events to store for each consumer, once this limit is reached the oldest is removed, default is 100, range is 1 to 100

Type: integer
Required: no
Default: 100

retryCommit

If a transacted session commit fails, if this is true, the commit is retried until either it succeeds or fails with a transaction timeout, default is false.

Type: boolean
Required: no
Default: false

enableMultiplexedConnections

if this is true, the session is multiplexed on a single connection else a new socket is created for each session, default is false.

Type: boolean
Required: no
Default: false

Child Elements of <mulemq-xa-connector…​>

Name Cardinality Description

abstract-jndi-name-resolver

0..1

A placeholder for jndi-name-resolver strategy elements.

Weblogic Connector

The weblogic-connector element configures a WebLogic version of the JMS connector.

Attributes of <weblogic-connector…​>

Name Description

connectionFactory-ref

Optional reference to the connection factory. A default connection factory is provided for vendor-specific JMS configurations.

Type: string
Required: no
Default: none

redeliveryHandlerFactory-ref

Reference to the redelivery handler.

Type: string
Required: no
Default: none

acknowledgementMode

The acknowledgement mode to use: AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, or DUPS_OK_ACKNOWLEDGE.

Type: enumeration
Required: no
Default: AUTO_ACKNOWLEDGE

clientId

The ID of the JMS client.

Type: string
Required: no
Default: none

durable

Whether to make all topic subscribers durable.

Type: boolean
Required: no
Default: none

noLocal

If set to true, a subscriber does not receive messages that were published by its own connection.

Type: boolean
Required: no
Default: none

persistentDelivery

If set to true, the JMS provider logs the message to stable storage as it is sent so that it can be recovered if delivery is unsuccessful. A client marks a message as persistent if it feels that the application has problems if the message is lost in transit. A client marks a message as non-persistent if an occasional lost message is tolerable. Clients use delivery mode to tell a JMS provider how to balance message transport reliability/throughput. Delivery mode only covers the transport of the message to its destination. Retention of a message at the destination until its receipt is acknowledged is not guaranteed by a PERSISTENT delivery mode. Clients should assume that message retention policies are set administratively. Message retention policy governs the reliability of message delivery from destination to message consumer. For example, if a client’s message storage space is exhausted, some messages as defined by a site specific message retention policy may be dropped. A message is guaranteed to be delivered once-and-only-once by a JMS Provider if the delivery mode of the message is persistent and if the destination has a sufficient message retention policy.

Type: boolean
Required: no
Default: none

honorQosHeaders

If set to true, the message’s QoS headers are honored. If false (the default), the connector settings override the message headers.

Type: boolean
Required: no
Default: none

maxRedelivery

The maximum number of times to try to redeliver a message. Use -1 to accept messages with any redelivery count.

Type: integer
Required: no
Default: none

cacheJmsSessions

Whether to cache and re-use the JMS session and producer object instead of recreating them for each request. The default behavior is to cache JMS Sessions and Producers (previous to 3.6, the default behavior was to not cache them). NOTE: This is NOT supported with XA transactions or JMS 1.0.2b.

Type: boolean
Required: no
Default: none

eagerConsumer

Whether to create a consumer right when the connection is created instead of using lazy instantiation in the poll loop.

Type: boolean
Required: no
Default: none

specification

The JMS specification to use: 1.0.2b (the default) or 1.1.

Type: enumeration
Required: no
Default: 1.0.2b

username

The user name for the connection.

Type: string
Required: no
Default: none.

password

The password for the connection

Type: string
Required: no
Default: none

numberOfConsumers

The number of concurrent consumers that are used to receive JMS messages. (Note: If you use this attribute, you should not configure the 'numberOfConcurrentTransactedReceivers', which has the same effect.)

Type: integer
Required: no
Default: none

jndiInitialFactory

The initial factory class to use when connecting to JNDI. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

jndiProviderUrl

The URL to use when connecting to JNDI. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

jndiProviderProperties-ref

Reference to a Map that contains additional provider properties. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

connectionFactoryJndiName

The name to use when looking up the connection factory from JNDI.

Type: string
Required: no
Default: none

jndiDestinations

Set this attribute to true if you want to look up queues or topics from JNDI instead of creating them from the session.

Type: boolean
Required: no
Default: none

forceJndiDestinations

If set to true, Mule fails when a topic or queue cannot be retrieved from JNDI. If set to false, Mule creates a topic or queue from the JMS session if the JNDI lookup fails.

Type: boolean
Required: no
Default: none

disableTemporaryReplyToDestinations

If this is set to false (the default), when Mule performs request/response calls a temporary destination that is automatically set to receive a response from the remote JMS call.

Type: boolean
Required: no
Default: none

embeddedMode

Some application servers, like WebSphere AS, don’t allow certain methods to be called on JMS objects, effectively limiting available features. Embedded mode tells Mule to avoid those whenever possible. Default is false.

Type: boolean
Required: no
Default: false

Child Elements of <weblogic-connector…​>

Name Cardinality Description

abstract-jndi-name-resolver

0..1

A placeholder for jndi-name-resolver strategy elements.

WebSphere Connector

The websphere-connector element configures a WebSphere version of the JMS connector.

Attributes of <websphere-connector…​>

Name Description

connectionFactory-ref

Optional reference to the connection factory. A default connection factory is provided for vendor-specific JMS configurations.

Type: string
Required: no
Default: none

redeliveryHandlerFactory-ref

Reference to the redelivery handler.

Type: string
Required: no
Default: none

acknowledgementMode

The acknowledgement mode to use: AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, or DUPS_OK_ACKNOWLEDGE.

Type: enumeration
Required: no
Default: AUTO_ACKNOWLEDGE

clientId

The ID of the JMS client.

Type: string
Required: no
Default: none

durable

Whether to make all topic subscribers durable.

Type: boolean
Required: no
Default: none

noLocal

If set to true, a subscriber does not receive messages that were published by its own connection.

Type: boolean
Required: no
Default: none

persistentDelivery

If set to true, the JMS provider logs the message to stable storage as it is sent so that it can be recovered if delivery is unsuccessful. A client marks a message as persistent if the application has problems when the message is lost in transit. A client marks a message as non-persistent if an occasional lost message is tolerable. Clients use delivery mode to tell a JMS provider how to balance message transport reliability/throughput. Delivery mode only covers the transport of the message to its destination. Retention of a message at the destination until its receipt is acknowledged is not guaranteed by a PERSISTENT delivery mode. Clients should assume that message retention policies are set administratively. Message retention policy governs the reliability of message delivery from destination to message consumer. For example, if a client’s message storage space is exhausted, some messages as defined by a site specific message retention policy may be dropped. A message is guaranteed to be delivered once-and-only-once by a JMS Provider if the delivery mode of the message is persistent and if the destination has a sufficient message retention policy.

Type: boolean
Required: no
Default: none

honorQosHeaders

If set to true, the message’s QoS headers are honored. If false (the default), the connector settings override the message headers.

Type: boolean
Required: no
Default: none

maxRedelivery

The maximum number of times to try to redeliver a message. Use -1 to accept messages with any redelivery count.

Type: integer
Required: no
Default: none

cacheJmsSessions

Whether to cache and re-use the JMS session and producer object instead of recreating them for each request. The default behavior is to cache JMS Sessions and Producers (previous to 3.6, the default behavior was to not cache them). NOTE: This is NOT supported with XA transactions or JMS 1.0.2b.

Type: boolean
Required: no
Default: true

eagerConsumer

Whether to create a consumer right when the connection is created instead of using lazy instantiation in the poll loop.

Type: boolean
Required: no
Default: none

specification

The JMS specification to use: 1.0.2b (the default) or 1.1.

Type: enumeration
Required: no
Default: 1.0.2b

username

The user name for the connection.

Type: string
Required: no
Default: none

password

The password for the connection.

Type: string
Required: no
Default: none

numberOfConsumers

The number of concurrent consumers that are used to receive JMS messages. (Note: If you use this attribute, you should not configure the 'numberOfConcurrentTransactedReceivers', which has the same effect.)

Type: integer
Required: no
Default: none

jndiInitialFactory

The initial factory class to use when connecting to JNDI. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

jndiProviderUrl

The URL to use when connecting to JNDI. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

jndiProviderProperties-ref

Reference to a Map that contains additional provider properties. DEPRECATED: use jndiNameResolver-ref properties to configure this value.

Type: string
Required: no
Default: none

connectionFactoryJndiName

The name to use when looking up the connection factory from JNDI.

Type: string
Required: no
Default: none

jndiDestinations

Set this attribute to true if you want to look up queues or topics from JNDI instead of creating them from the session.

Type: boolean
Required: no
Default: none

forceJndiDestinations

If set to true, Mule fails when a topic or queue cannot be retrieved from JNDI. If set to false, Mule creates a topic or queue from the JMS session if the JNDI lookup fails.

Type: boolean
Required: no
Default: none

disableTemporaryReplyToDestinations

If this is set to false (the default), when Mule performs request/response calls a temporary destination automatically is set to receive a response from the remote JMS call.

Type: boolean
Required: no
Default: none

embeddedMode

Some application servers, like WebSphere AS, don’t allow certain methods to be called on JMS objects, effectively limiting available features. Embedded mode tells Mule to avoid those whenever possible. Default is false.

Type: boolean
Required: no
Default: false

Child Elements of <websphere-connector…​>

Name Cardinality Description

abstract-jndi-name-resolver

0..1

A placeholder for jndi-name-resolver strategy elements.

Transaction

The transaction element configures a transaction. Transactions allow a series of operations to be grouped together so that they can be rolled back if a failure occurs. Set the action (such as ALWAYS_BEGIN or JOIN_IF_POSSIBLE) and the timeout setting for the transaction.

No Child Elements of <transaction…​>

Client ack transaction

The client-ack-transaction element configures a client acknowledgment transaction, which is identical to a transaction but with message acknowledgements. There is no notion of rollback with client acknowledgement, but this transaction can be useful for controlling how messages are consumed from a destination.

No Child Elements of <client-ack-transaction…​>

Default JNDI Name Resolver

Attributes of <default-jndi-name-resolver…​>

Name Description

jndiInitialFactory

The initial factory class to use when connecting to JNDI.

Type: string
Required: yes
Default: none

jndiProviderUrl

The URL to use when connecting to JNDI.

Type: string
Required: yes
Default: none

jndiProviderProperties-ref

Reference to a Map that contains additional provider properties.

Type: string
Required: no
Default: none

initialContextFactory-ref

Reference to a javax.naming.spi.InitialContextFactory implementation that’s used to create the JNDI context.

Type: string
Required: no
Default: none

No Child Elements of <default-jndi-name-resolver…​>

Custom JNDI name resolver

Attributes of <custom-jndi-name-resolver…​>

Name Description

class

An implementation of the LifecycleAdapter interface.

Type: class name
Required: yes
Default: none

Child Elements of <custom-jndi-name-resolver…​>

Name Cardinality Description

spring:property

0..*

Spring-style property element for custom configuration.

Caching Connection Factory

DEPRECATED: This element is deprecated from Mule 3.6. This can still but used in 3.6, but it not necessary given that from Mule 3.6 JMS connections cache Sessions/Producers by default when a CachingConnectionFactory has not been configured explicitly.

Attributes of <caching-connection-factory…​>

Name Description

name

Identifies the pool so that a connector can reference it.

Type: name (no spaces)
Required: yes
Default: none

sessionCacheSize

Defines the maximum amount of connections that can be in the pool. NOTE: This cache size is the maximum limit for the number of cached Sessions per session acknowledgement type (auto, client, dups_ok, transacted). As a consequence, the actual number of cached Sessions may be up to four times as high as the specified value - in the unlikely case of mixing and matching different acknowledgement types.

Type: integer
Required: no
Default: 1

cacheProducers

Indicates whether to cache JMS MessageProducers for the JMS connection. Default is true

Type: boolean
Required: no
Default: true

connectionFactory-ref

Reference to the connection factory

Type: name (no spaces)
Required: yes
Default: none

username

The user name for the connection.

Type: string
Required: no
Default: none

password

The password for the connection.

Type: string
Required: no
Default: none

No Child Elements of <caching-connection-factory…​>

XML Schema

Import the XML schema for this module as follows:

xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/jms  http://www.mulesoft.org/schema/mule/jms/3.6/mule-jms.xsd"

Javadoc

Javadoc for this transport can be found below:

Maven

If you are using Maven to build your application, use the following groupId and artifactId to include this module as a dependency:

<dependency>
  <groupId>org.mule.transports</groupId>
  <artifactId>mule-transport-jms</artifactId>
</dependency>

Notes

The JMS 1.0.2b specification has the limitation of only supporting queues or topics for each ConnectionFactory. If you need both, configure two separate connectors, one that references a QueueConnectionFactory, and another that references a TopicConnectionFactory. You can then use the connector-ref attribute to disambiguate the endpoints.

Workaround for 1.0.2b Specification

<spring:bean name="queueConnectionFactory" class="com.foo.QueueConnectionFactory"/>
<spring:bean name="topicConnectionFactory" class="com.foo.TopicConnectionFactory"/>

<jms:connector name="jmsQueueConnector" connectionFactory-ref="queueConnectionFactory" />
<jms:connector name="jmsTopicConnector" connectionFactory-ref="topicConnectionFactory" />

<jms:outbound-endpoint queue="my.queue1" connector-ref="jmsQueueConnector"/>
<jms:outbound-endpoint queue="my.queue2" connector-ref="jmsQueueConnector"/>

<jms:inbound-endpoint topic="my.topic" connector-ref="jmsTopicConnector"/>