Contact Us 1-800-596-4880

JMS Connector Reference 1.2 - Mule 4

JMS Connector Version 1.2

Anypoint Connector for JMS (JMS Connector) is a JMS 1.0.2b, 1.1, and 2.0 compliant MuleSoft Extension, used to consume and produce JMS messages. The extension supports all JMS functionality including topics and queues, durable subscribers, acknowledgment modes and local transactions.

Configurations


Default Configuration

Base configuration for JMS Connector

Parameters

Name Type Description Default Value Required

Name

String

The name for this configuration. Connectors reference the configuration with this name.

x

Encoding

String

The default encoding of the Message body to use if the message doesn’t communicate it.

Content Type

String

The default contentType of the Message body to use if the message doesn’t communicate it.

/

Send Correlation Id

Enumeration, one of:

  • AUTO

  • ALWAYS

  • NEVER

Whether to specify a correlationId when publishing messages. This applies both for custom correlation IDs specifies at the operation level and for default correlation IDs taken from the current event.

AUTO

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before the runtime considers it eligible for expiration. This does not mean that the platform expires the instance at the exact moment that it becomes eligible. The runtime purges the instances when it sees fit.

Ack Mode

Enumeration, one of:

  • IMMEDIATE

  • AUTO

  • MANUAL

  • DUPS_OK

The ConsumerAckMode to use when consuming a Message Can be overridden at the message source level. This attribute has to be IMMEDIATE if the transactionType is LOCAL or MULTI.

AUTO

Consumer Type

One of:

The ConsumerType to use by default when consuming a Message Can be overridden at the message source level.

Selector

String

Default selector to use for filtering when consuming a Message Can be overridden at the message source level.

Max Redelivery

Number

NOTE: Do not configure this parameter in the connector, as it has no effect. This must be configured on the broker side.

Used to configure the number of redelivers before discarding the message. No redelivery is represented with 0, while -1 means infinite re deliveries accepted.

0

Persistent Delivery

Boolean

Sets the default value for the Message#getJMSDeliveryMode. If true, the DeliveryMode#PERSISTENT mode will be used, which instructs the JMS provider to take extra care to insure the message is not lost in transit due to a JMS provider failure.

false

Priority

Number

Defines the default Message#getJMSPriority to use when sending messages.

4

Time To Live

Number

Defines the default time the message is in the broker before it expires and is discarded.

0

Time To Live Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A TimeUnit which qualifies the #timeToLive attribute. Defaults to MILLISECONDS.

MILLISECONDS

Disable Message Id

Boolean

Defines the default value to use when producing messages, for disabling the Message#getJMSMessageID generation in the broker. Depending on the provider it may or may not have effect.

false

Disable Message Timestamp

Boolean

Defines the default value to use, when producing messages, for disable Message#getJMSTimestamp generation in the broker. Depending on the provider it may or may not have effect.

false

Delivery Delay

Number

This is used to determine the Message delivery delay time which is calculated by adding the deliveryDelay value specified on the send method to the time the message was sent. Only used in JmsSpecification#JMS_2_0.

Delivery Delay Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A TimeUnit which qualifies the #deliveryDelay attribute. Defaults to MILLISECONDS.

MILLISECONDS

Jms Type

String

A message JMSType identifier supplied by a client when a message is sent.

Associated Operations

Associated Sources

Operations

Consume

<jms:consume>

Operation that allows the user to consume a single Message from a given Destination.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Destination

String

The name of the Destination from where the Message should be consumed.

x

Consumer Type

One of:

The type of the MessageConsumer that is required for the given destination, along with any extra configurations that are required based on the destination type.

Ack Mode

Enumeration, one of:

  • IMMEDIATE

  • MANUAL

The ConsumerAckMode to configure over the Message and Session.

Selector

String

A custom JMS selector for filtering the messages.

Content Type

String

The Message’s content type.

Encoding

String

The Message’s content encoding.

Maximum Wait

Number

Maximum time to wait for a message before timing out.

10000

Maximum Wait Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit to use in the maximumWaitTime configurations.

MILLISECONDS

Transactional Action

Enumeration, one of:

  • ALWAYS_JOIN

  • JOIN_IF_POSSIBLE

  • NOT_SUPPORTED

The type of joining action that operations can take regarding transactions.

JOIN_IF_POSSIBLE

Target Variable

String

The name of a variable to store the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors.

Output

Type

Any

Attributes Type

For Configurations

Throws

  • JMS:RETRY_EXHAUSTED

  • JMS:ACK

  • JMS:DESTINATION_NOT_FOUND

  • JMS:SECURITY

  • JMS:TIMEOUT

  • JMS:CONNECTIVITY

  • JMS:CONSUMING

Publish

<jms:publish>

Operation that allows the user to send a Message to a JMS Destination.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Destination

String

The name of the Destination where the Message should be sent.

x

Destination Type

Enumeration, one of:

  • QUEUE

  • TOPIC

The DestinationType of the destination

QUEUE

Transactional Action

Enumeration, one of:

  • ALWAYS_JOIN

  • JOIN_IF_POSSIBLE

  • NOT_SUPPORTED

Transactional Action for the operation. Indicates if the publish must be executed or not in a transaction.

JOIN_IF_POSSIBLE

Send Correlation Id

Enumeration, one of:

  • AUTO

  • ALWAYS

  • NEVER

options on whether to include an outbound correlation ID or not.

Body

Any

The body of the Message.

#[payload]

Jms Type

String

The JMSType header of the Message.

Correlation Id

String

The JMSCorrelationID header of the Message.

Send Content Type

Boolean

True if the body type should be sent as a Message property.

true

ContentType

String

The content type of the body.

Send Encoding

Boolean

True if the body outboundEncoding should be sent as a Message property.

true

Encoding

String

The outboundEncoding of the message’s body.

Reply To

The JMSReplyTo header information of the Destination where this Message should be replied to.

User Properties

Object

The custom user properties that should be set to this Message.

JMSX Properties

The JMSX properties that should be set to this Message.

Persistent Delivery

Boolean

If true, the Message is sent using the PERSISTENT JMSDeliveryMode.

Priority

Number

The default JMSPriority value to use when sending the message.

Time To Live

Number

Defines the default time the message is in the broker before it expires and is discarded.

Time To Live Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit to use in the timeToLive configurations.

Disable Message Id

Boolean

If true, the Message is flagged to avoid generating its MessageID.

Disable Message Timestamp

Boolean

If true, the Message is flagged to avoid generating its sent Timestamp.

Delivery Delay

Number

Only used by JMS 2.0. Sets the delivery delay to be applied to postpone the Message delivery.

Delivery Delay Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit to use in the deliveryDelay configurations.

Reconnection Strategy

A retry strategy in case of connectivity errors.

For Configurations

Throws

  • JMS:RETRY_EXHAUSTED

  • JMS:ILLEGAL_BODY

  • JMS:PUBLISHING

  • JMS:DESTINATION_NOT_FOUND

  • JMS:SECURITY

  • JMS:CONNECTIVITY

Publish Consume

<jms:publish-consume>

Operation that allows the user to send a message to a JMS Destination and waits for a response either to the provided ReplyTo destination or to a temporary Destination created dynamically.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Destination

String

The name of the Destination where the Message should be sent.

x

Send Correlation Id

Enumeration, one of:

  • AUTO

  • ALWAYS

  • NEVER

Options on whether to include an outbound correlation ID or not.

Body

Any

The body of the Message.

#[payload]

Jms Type

String

The JMSType header of the Message.

Correlation Id

String

The JMSCorrelationID header of the Message.

Send Content Type

Boolean

True if the body type should be sent as a Message property.

true

ContentType

String

The content type of the body.

Send Encoding

Boolean

True if the body outboundEncoding should be sent as a Message property.

true

Encoding

String

The outboundEncoding of the message’s body.

Reply To

The JMSReplyTo header information of the Destination where this Message should be replied to.

User Properties

Object

The custom user properties that should be set to this Message.

JMSX Properties

The JMSX properties that should be set to this Message.

Persistent Delivery

Boolean

If true, the Message is sent using the PERSISTENT JMSDeliveryMode.

Priority

Number

The default JMSPriority value to use when sending the message.

Time To Live

Number

Defines the default time the message is in the broker before it expires and is discarded.

Time To Live Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit to use in the timeToLive configurations.

Disable Message Id

Boolean

If true, the Message is flagged to avoid generating its MessageID.

Disable Message Timestamp

Boolean

If true, the Message is flagged to avoid generating its sent Timestamp.

Delivery Delay

Number

Only used by JMS 2.0. Sets the delivery delay to be applied to postpone the Message delivery.

Delivery Delay Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit to use in the deliveryDelay configurations.

Ack Mode

Enumeration, one of:

  • IMMEDIATE

  • MANUAL

The Session ACK mode to use when consuming the message.

Maximum Wait

Number

Maximum time to wait for a message to arrive before timeout.

10000

Maximum Wait Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit to use in the maximumWaitTime configuration.

MILLISECONDS

Content Type

String

The content type of the message body to be consumed.

Encoding

String

The encoding of the message body to be consumed.

Target Variable

String

The name of a variable to store the operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors.

Output

Type

Any

Attributes Type

For Configurations

Throws

  • JMS:RETRY_EXHAUSTED

  • JMS:ILLEGAL_BODY

  • JMS:ACK

  • JMS:PUBLISHING

  • JMS:DESTINATION_NOT_FOUND

  • JMS:SECURITY

  • JMS:TIMEOUT

  • JMS:CONNECTIVITY

  • JMS:CONSUMING

Ack

<jms:ack>

Allows the user to perform an ACK when the AckMode#MANUAL mode is elected while consuming the Message. As per JMS Spec, performing an ACK over a single Message automatically works as an ACK for all the Messages produced in the same JmsSession.

Parameters

Name Type Description Default Value Required

Ack Id

String

The AckId of the Message to ACK.

x

Throws

  • JMS:ACK

Recover Session

<jms:recover-session>

Allows the user to perform a session recover when the AckMode#MANUAL mode is elected while consuming the Message. As per JMS Spec, performing a session recover automatically redelivers all the consumed messages that had not being acknowledged before this recover.

Parameters

Name Type Description Default Value Required

Ack Id

String

The AckId of the Message Session to recover

x

Throws

  • JMS:SESSION_RECOVER

Sources

Listener

<jms:listener>

JMS Subscriber for Destinations, allows to listen for incoming Messages.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Destination

String

The name of the Destination from where the Message should be consumed.

x

Consumer Type

One of:

The Type of the Consumer that should be used for the provided destination.

Ack Mode

Enumeration, one of:

  • IMMEDIATE

  • AUTO

  • MANUAL

  • DUPS_OK

The Session ACK mode to use when consuming a message.

Selector

String

JMS selector to use for filtering incoming messages.

Inbound Content Type

String

The content type of the message body.

Inbound Encoding

String

The inboundEncoding of the message body.

Number Of Consumers

Number

The number of concurrent consumers to use to receive JMS Messages.

4

Transactional Action

Enumeration, one of:

  • ALWAYS_BEGIN

  • NONE

The type of beginning action that sources can take regarding transactions.

NONE

Transaction Type

Enumeration, one of:

  • LOCAL

  • XA

The type of transaction to create. Availability depends on the runtime version.

LOCAL

Primary Node Only

Boolean

Whether this source should only be executed on the primary node when running in Cluster.

true

Redelivery Policy

Defines a policy for processing the redelivery of the same message.

Reconnection Strategy

A retry strategy in case of connectivity errors.

Body

Any

The body of the Message.

#[payload]

Jms Type

String

The JMSType header of the Message.

Correlation Id

String

The JMSCorrelationID header of the Message.

Send Content Type

Boolean

True if the body type should be sent as a Message property.

true

ContentType

String

The content type of the body.

Send Encoding

Boolean

True if the body outboundEncoding should be sent as a Message property.

true

Encoding

String

The outboundEncoding of the message’s body.

Reply To

The JMSReplyTo header information of the Destination where this Message should be replied to.

User Properties

Object

The custom user properties that should be set to this Message.

JMSX Properties

The JMSX properties that should be set to this Message.

Persistent Delivery

Boolean

Whether or not the delivery should be done with a persistent configuration.

Priority

Number

The default JMSPriority value to use when sending the message.

Time To Live

Number

Defines the default time the message is in the broker before it expires and is discarded.

Time To Live Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit to use in the timeToLive configurations.

Disable Message Id

Boolean

If true, the Message is flagged to avoid generating its MessageID.

Disable Message Timestamp

Boolean

If true, the Message is flagged to avoid generating its sent Timestamp.

Delivery Delay

Number

Only used by JMS 2.0. Sets the delivery delay to be applied to postpone the Message delivery.

Delivery Delay Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit to use in the deliveryDelay configurations.

Output

Type

Any

Attributes Type

For Configurations

Types

Expiration Policy

Field Type Description Default Value Required

Max Idle Time

Number

A scalar time value for the maximum amount of time a dynamic configuration instance should be allowed to be idle before it’s considered eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A time unit that qualifies the maxIdleTime attribute.

JMS Attributes

Field Type Description Default Value Required

Properties

Container element for all the properties present in a JMS Message.

x

Headers

All the possible headers of a JMS Message.

x

Ack Id

String

The session ACK ID required to ACK a the current Message if one is available, or null otherwise.

JMS Message Properties

Field Type Description Default Value Required

All

Object

x

User Properties

Object

x

Jms Properties

Object

x

Jmsx Properties

x

JMSX Properties

Field Type Description Default Value Required

Jmsx User ID

String

The identity of the user sending the message.

Jmsx App ID

String

The identity of the application sending the message.

Jmsx Delivery Count

Number

The number of message delivery attempts.

Jmsx Group ID

String

The identity of the message group this message is part of.

Jmsx Group Seq

Number

The sequence number of this message within the group.

Jmsx Producer TXID

String

The transaction identifier of the transaction within which this message was produced.

Jmsx Consumer TXID

String

The transaction identifier of the transaction within which this message was consumed.

Jmsx Rcv Timestamp

Number

The time JMS delivered the message to the consumer.

JMS Headers

Field Type Description Default Value Required

Destination

Delivery Mode

Number

x

Expiration

Number

x

Priority

Number

x

Message Id

String

Timestamp

Number

x

Correlation Id

String

Reply To

Type

String

Redelivered

Boolean

false

Delivery Time

Number

JMS Destination

Field Type Description Default Value Required

Destination

String

The name that identifies the destination where to send a reply to a message.

x

Destination Type

Enumeration, one of:

  • QUEUE

  • TOPIC

The type of this destination.

QUEUE

Redelivery Policy

Field Type Description Default Value Required

Max Redelivery Count

Number

NOTE: Do not configure this parameter in the connector, as it has no effect. This must be configured on the broker side.

The maximum number of times a message can be redelivered and processed unsuccessfully before triggering process-failed-message.

Use Secure Hash

Boolean

Whether to use a secure hash algorithm to identify a redelivered message.

Message Digest Algorithm

String

The secure hashing algorithm to use. If not set, the default is SHA-256.

Id Expression

String

Defines one or more expressions to use to determine when a message has been redelivered. This property may only be set if useSecureHash is false.

Object Store

Object Store

The object store where the redelivery counter for each message is going to be stored.

Reconnect

Field Type Description Default Value Required

Frequency

Number

How often to reconnect (in milliseconds)

Count

Number

The number of reconnection attempts to make

blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread

true

Reconnect Forever

Field Type Description Default Value Required

Frequency

Number

How often in milliseconds to reconnect

blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread

true

Reconnection

Field Type Description Default Value Required

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Reconnection Strategy

The reconnection strategy to use.

Active MQ Connection Factory Configuration

Field Type Description Default Value Required

Broker Url

String

The address of the broker to connect.

vm://localhost?broker.persistent=false&broker.useJmx=false

Enable Xa

Boolean

ConnectionFactory should support XA.

false

Initial Redelivery Delay

Number

Used to configure the RedeliveryPolicy#getInitialRedeliveryDelay().

1000

Redelivery Delay

Number

Used to configure the RedeliveryPolicy#getRedeliveryDelay().

1000

Max Redelivery

Number

NOTE: Do not configure this parameter in the connector, as it has no effect. This must be configured on the broker side.

Used to configure the RedeliveryPolicy#getMaximumRedeliveries(). 0 means no redelivery. -1 means infinite re deliveries are accepted.

0

Trusted Packages

Array of String

Allowed packages of classes to send and receive. Starting with versions 5.12.2 and 5.13.0, ActiveMQ requires you to explicitly allow packages that can be exchanged using ObjectMessages.

Trust All Packages

Boolean

Indicates if a class from any package can be sent and received. Enabling this parameter is unsafe because a malicious payload can exploit the host system. Starting with versions 5.12.2 and 5.13.0, ActiveMQ requires you to explicitly allow packages that can be exchanged using ObjectMessages.

false

Topic Consumer

Field Type Description Default Value Required

Durable

Boolean

Allows an application to receive all the messages published on a topic, including the ones published when there is no consumer associated with it.

Requires a subscriptionName to be provided.

false

Shared

Boolean

Only for JMS 2.0: Allows the processing of messages from at topic subscription by multiple threads, connections or JVMs.

Requires a subscriptionName to be provided.

false

No Local

Boolean

Specifies that messages published to the topic by its own connection must not be added to the subscription.

false

Subscription Name

String

The name to use for the subscription.

Default Caching

Field Type Description Default Value Required

Session Cache Size

Number

Number of sessions to cache.

Cache Producers

Boolean

MessageProducers

true

Cache Consumers

Boolean

MessageConsumers

true

JNDI Connection Factory

Field Type Description Default Value Required

Connection Factory Jndi Name

String

Name of the ConnectionFactory to be discovered using Jndi and used as a delegate of ConnectionFactory.

x

Lookup Destination

Enumeration, one of:

  • NEVER

  • ALWAYS

  • TRY_ALWAYS

The Destinations

NEVER

Name Resolver Provider

Provider for the JndiNameResolver.

x

JNDI Name Resolver Provider

Field Type Description Default Value Required

Custom JNDI Name Resolver

Name Resolver Builder

JNDI Name Resolver Properties

Field Type Description Default Value Required

Jndi Initial Context Factory

String

x

Jndi Provider Url

String

Provider Properties

Object

Simple JNDI Name Resolver

Field Type Description Default Value Required

Context Factory

Any

Jndi Initial Factory

String

Jndi Provider Properties

Object

Jndi Provider Url

String

Cached JNDI Name Resolver

Field Type Description Default Value Required

Context Factory

Any

Jndi Initial Factory

String

Jndi Provider Properties

Object

Jndi Provider Url

String

View on GitHub