JMS Connector Reference | MuleSoft Documentation
# JMS Connector Reference
JMS Connector v1.7
Anypoint Connector for JMS (JMS Connector) enables your app to do messaging using the JMS implementation of your choice.
The JMS documentation set provides information about multiple versions of the JMS connector.
For information about each Mule 4 JMS Connector version, see:
  * JMS Connector v1.7.x Reference
  * JMS Connector v1.6.x Reference
  * JMS Connector v1.5.x Reference
  * JMS Connector v1.4.x Reference
  * JMS Connector v1.3.x Reference
  * JMS Connector v1.2.x Reference
  * JMS Connector v1.1.x Reference
  * JMS Connector v1.0.x Reference


Release Notes: JMS Connector Release Notes
## Configurations
### Default Configuration
Base configuration for JMS Connector
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
The name of this configuration. With this name can be later referenced.  
Encoding | The default encoding of the Message body to use if the message doesn’t communicate it  
Content Type | The default contentType of the Message body to use if the message doesn’t communicate it  
Ack Mode |  Enumeration, one of:
  * IMMEDIATE
  * 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 transactionType is LOCAL or MULTI  
Consumer Type |  One of:
  * queue-consumer
  * 
| The ConsumerType to use by default when consuming a Message Can be overridden at the message source level.  
Selector | Default selector to use for filtering when consuming a Message Can be overridden at the message source level.  
Max Redelivery | Used to configure the number of redelivers before discarding the message. No redelivery is represented with 0, while -1 means infinite re deliveries accepted.  
Persistent Delivery | Sets the default value for the Message#getJMSDeliveryMode. If true, the DeliveryMode#PERSISTENT mode is 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.  
Priority | Defines the default Message#getJMSPriority to use when sending messages  
Time To Live | 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

| A TimeUnit which qualifies the #timeToLive attribute. Defaults to MILLISECONDS | MILLISECONDS  
Disable Message Id | 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  
Disable Message Timestamp | 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.  
Delivery Delay | 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

| A TimeUnit which qualifies the #deliveryDelay attribute. Defaults to MILLISECONDS | MILLISECONDS  
Jms Type | A message JMSType identifier supplied by a client when a message is sent.  
## Operations
  * Publish Consume


### Associated Sources
## Operations
### Consume
`<http://www.mulesoft.org/schema/mule/jms:consume>`
Operation that allows the user to consume a single Message from a given Destination, extra configurations that are required based on the destination type and headers as Result#getAttributes.
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | The name of the configuration to use.  
Destination | The name of the Destination from where the Message should be consumed  
Consumer Type |  One of:
  * queue-consumer
  * 
| The type of the MessageConsumer that is required for the given destination, along with any  
Ack Mode |  Enumeration, one of:
  * IMMEDIATE
  * MANUAL

| The ConsumerAckMode to configure over the Message and Session  
Selector | A custom JMS selector for filtering the messages  
Content Type | The Message’s content content type  
Encoding | The Message’s content encoding  
Maximum Wait | Maximum time to wait for a message before timing out  
Maximum Wait Unit |  Enumeration, one of:
  * NANOSECONDS
  * MICROSECONDS
  * MILLISECONDS
  * SECONDS
  * MINUTES
  * HOURS

| 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 | The name of a variable to store the operation’s output.  
#### Output
Attributes Type |  JMS Attributes  
---|---  
### For Configurations
  * Default Configuration


#### Throws
  * JMS:ACK
  * JMS:CONNECTIVITY
  * JMS:CONSUMING
  * JMS:DESTINATION_NOT_FOUND
  * JMS:RETRY_EXHAUSTED
  * JMS:TIMEOUT


### Publish
`<http://www.mulesoft.org/schema/mule/jms:publish>`
Operation that allows the user to send a Message to a JMS Destination
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | The name of the configuration to use.  
Destination | The name of the Destination where the Message should be sent  
Destination Type |  Enumeration, one of:
  * QUEUE
  * TOPIC

| The type of the Destination  
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  
The body of the Message | `#[payload]`  
Jms Type | The JMSType header of the Message  
Correlation Id | The JMSCorrelationID header of the Message  
Send Content Type | True if the body type should be sent as a Message property  
ContentType | The content type of the body  
Send Encoding | True if the body outboundEncoding should be sent as a Message property  
Encoding | The outboundEncoding of the message’s body  
Reply To |  JMS Destination | The JMSReplyTo header information of the Destination where this Message should be replied to  
User Properties | The custom user properties that should be set to this Message  
JMSX Properties |  JMSX Properties | The JMSX properties that should be set to this Message  
Persistent Delivery | If true, the Message is sent using the PERSISTENT JMSDeliveryMode  
Priority | The default JMSPriority value to use when sending the message  
Time To Live | 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

| Time unit to use in the timeToLive configurations  
Disable Message Id | If true, the Message is flagged to avoid generating its MessageID  
Disable Message Timestamp | If true, the Message is flagged to avoid generating its sent Timestamp  
Delivery Delay | 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

| Time unit to use in the deliveryDelay configurations  
### For Configurations
  * Default Configuration


#### Throws
  * JMS:CONNECTIVITY
  * JMS:DESTINATION_NOT_FOUND
  * JMS:ILLEGAL_BODY
  * JMS:PUBLISHING
  * JMS:RETRY_EXHAUSTED
| Time unit to use in the timeToLive configurations  
Disable Message Id | If true, the Message is flagged to avoid generating its MessageID  
Disable Message Timestamp | If true, the Message is flagged to avoid generating its sent Timestamp  
Delivery Delay | 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

| Time unit to use in the deliveryDelay configurations  
### For Configurations
  * Default Configuration


#### Throws
  * JMS:CONNECTIVITY
  * JMS:DESTINATION_NOT_FOUND
  * JMS:ILLEGAL_BODY
  * JMS:PUBLISHING
  * JMS:RETRY_EXHAUSTED


### Publish Consume
`<http://www.mulesoft.org/schema/mule/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 and headers as Result#getAttributes.
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | The name of the configuration to use.  
Destination | The name of the Destination where the Message should be sent  
The body of the Message | `#[payload]`  
Jms Type | The JMSType header of the Message  
Correlation Id | The JMSCorrelationID header of the Message  
Send Content Type | True if the body type should be sent as a Message property  
ContentType | The content type of the body  
Send Encoding | True if the body outboundEncoding should be sent as a Message property  
Encoding | The outboundEncoding of the message’s body  
Reply To |  JMS Destination | The JMSReplyTo header information of the Destination where this Message should be replied to  
User Properties | The custom user properties that should be set to this Message  
JMSX Properties |  JMSX Properties | The JMSX properties that should be set to this Message  
Persistent Delivery | If true, the Message is sent using the PERSISTENT JMSDeliveryMode  
Priority | The default JMSPriority value to use when sending the message  
Time To Live | 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

| Time unit to use in the timeToLive configurations  
Disable Message Id | If true, the Message is flagged to avoid generating its MessageID  
Disable Message Timestamp | If true, the Message is flagged to avoid generating its sent Timestamp  
Delivery Delay | 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

| 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 | Maximum time to wait for a message to arrive before timeout  
Maximum Wait Unit |  Enumeration, one of:
  * NANOSECONDS
  * MICROSECONDS
  * MILLISECONDS
  * SECONDS
  * MINUTES
  * HOURS

| Time unit to use in the maximumWaitTime configuration | MILLISECONDS  
Content Type | The content type of the message body to be consumed  
Encoding | The encoding of the message body to be consumed  
Target Variable | The name of a variable to store the operation’s output.  
#### Output
Attributes Type |  JMS Attributes  
---|---  
### For Configurations
  * Default Configuration


#### Throws
  * JMS:ACK
  * JMS:CONNECTIVITY
  * JMS:CONSUMING
  * JMS:DESTINATION_NOT_FOUND
  * JMS:ILLEGAL_BODY
  * JMS:PUBLISHING
  * JMS:RETRY_EXHAUSTED
  * JMS:TIMEOUT


`<http://www.mulesoft.org/schema/mule/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 to a session of the current connection.
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
The AckId of the Message to ACK  
#### Throws
### Recover Session
`<http://www.mulesoft.org/schema/mule/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 been acknowledged before this recover.
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
The AckId of the Message Session to recover  
#### Throws
  * JMS:SESSION_RECOVER


## Sources
### Listener
`<http://www.mulesoft.org/schema/mule/jms:listener>`
JMS Subscriber for Destinations, allows to listen for incoming Messages
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | The name of the configuration to use.  
Destination | The name of the Destination from where the Message should be consumed  
Consumer Type |  One of:
  * queue-consumer
  * 
| The Type of the Consumer that should be used for the provided destination  
Ack Mode |  Enumeration, one of:
  * IMMEDIATE
  * MANUAL
  * DUPS_OK

| The Session ACK mode to use when consuming a message  
Selector | JMS selector to use for filtering incoming messages  
Inbound Content Type | The content type of the message body  
Inbound Encoding | The inboundEncoding of the message body  
Number Of Consumers | The number of concurrent consumers to use to receive JMS Messages  
Transactional Action |  Enumeration, one of:
  * ALWAYS_BEGIN

| The type of beginning action that sources can take regarding transactions.  
Redelivery Policy |  Redelivery Policy | Defines a policy for processing the redelivery of the same message  
Reconnection Strategy | 
  *   * Reconnect Forever

| A retry strategy in case of connectivity errors.  
The body of the Message | `#[payload]`  
Jms Type | The JMSType identifier header of the Message  
Correlation Id | The JMSCorrelationID header of the Message  
Send Content Type | Whether or not the body content type should be sent as a property  
ContentType | The content type of the message’s body  
Send Encoding | Whether or not the body outboundEncoding should be sent as a Message property  
Encoding | The encoding of the message’s body  
Reply To |  JMS Destination | The destination where a reply to this Message should be sent  
User Properties | The custom user properties that should be set to this Message  
JMSX Properties |  JMSX Properties | The JMSX properties that should be set to this Message  
Persistent Delivery | Whether or not the delivery should be done with a persistent configuration  
Priority | The default JMSPriority value to use when sending the message  
Time To Live | 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

| Time unit to use in the timeToLive configurations  
Disable Message Id | If true, the Message is flagged to avoid generating its MessageID  
Disable Message Timestamp | If true, the Message is flagged to avoid generating its sent Timestamp  
Delivery Delay | 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

| Time unit to use in the deliveryDelay configurations  
#### Output
Attributes Type |  JMS Attributes  
---|---  
### For Configurations
  * Default Configuration


#### Throws
  * MULE:SOURCE_ERROR_RESPONSE_GENERATE
  * MULE:SOURCE_ERROR_RESPONSE_SEND
  * MULE:SOURCE_RESPONSE_GENERATE
  * MULE:SOURCE_RESPONSE_SEND
| Time unit to use in the timeToLive configurations  
Disable Message Id | If true, the Message is flagged to avoid generating its MessageID  
Disable Message Timestamp | If true, the Message is flagged to avoid generating its sent Timestamp  
Delivery Delay | 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

| Time unit to use in the deliveryDelay configurations  
#### Output
Attributes Type |  JMS Attributes  
---|---  
### For Configurations
  * Default Configuration


#### Throws
  * MULE:SOURCE_ERROR_RESPONSE_GENERATE
  * MULE:SOURCE_ERROR_RESPONSE_SEND
  * MULE:SOURCE_RESPONSE_GENERATE
  * MULE:SOURCE_RESPONSE_SEND


## Types
### Redelivery Policy
Field | Type | Default Value  
---|---|---  
Max Redelivery Count  
Use Secure Hash  
Message Digest Algorithm  
Id Expression  
Object Store Ref  
### Reconnect
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Frequency | How often in milliseconds to reconnect.  
How many reconnection attempts to make.  
blocking | If false, the reconnection strategy runs in a separate, non-blocking thread.  
### Reconnect Forever
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Frequency | How often in milliseconds to reconnect.  
blocking | If false, the reconnection strategy runs in a separate, non-blocking thread.  
### JMS Destination
Field | Type | Default Value  
---|---|---  
Destination  
Destination Type |  Enumeration, one of:
  * QUEUE
  * TOPIC

  
### JMSX Properties
Field | Type | Default Value  
---|---|---  
Jmsx User ID  
Jmsx App ID  
Jmsx Delivery Count  
Jmsx Group ID  
Jmsx Group Seq  
Jmsx Producer TXID  
Jmsx Consumer TXID  
Jmsx Rcv Timestamp  
### Pooling Profile
Field | Type | Default Value  
---|---|---  
Max Active  
Min Eviction Millis  
Eviction Check Interval Millis  
Exhausted Action |  Enumeration, one of:
  * WHEN_EXHAUSTED_GROW
  * WHEN_EXHAUSTED_WAIT
  * WHEN_EXHAUSTED_FAIL

  
Initialisation Policy |  Enumeration, one of:
  * INITIALISE_NONE
  * INITIALISE_ONE
  * INITIALISE_ALL

  
### Active MQ Connection Factory Configuration
Field | Type | Default Value  
---|---|---  
Broker Url | vm://localhost?broker.persistent=false&broker.useJmx=false  
Enable Xa  
Initial Redelivery Delay  
Redelivery Delay  
Max Redelivery  
### Topic Consumer
Field | Type | Default Value  
---|---|---  
Is Durable  
Is Shared  
No Local  
Subscription Name  
### Default Caching
Field | Type | Default Value  
---|---|---  
Session Cache Size  
Cache Producers  
Cache Consumers  
### JNDI Connection Factory
Field | Type | Default Value  
---|---|---  
Connection Factory Jndi Name  
Lookup Destination |  Enumeration, one of:
  * NEVER
  * ALWAYS
  * TRY_ALWAYS

  
Name Resolver Provider |  JNDI Name Resolver Provider  
### JNDI Name Resolver Provider
Field | Type | Default Value  
---|---|---  
Custom Jndi Name Resolver |  One of:
  * Simple JNDI Name Resolver
  * Cached JNDI Name Resolver

  
Name Resolver Builder |  JNDI Name Resolver Properties  
### JNDI Name Resolver Properties
Field | Type | Default Value  
---|---|---  
Jndi Initial Context Factory  
Jndi Provider Url  
Provider Properties  
### Simple JNDI Name Resolver
Field | Type | Default Value  
---|---|---  
Context Factory  
Jndi Initial Factory  
Jndi Provider Properties  
Jndi Provider Url  
### Cached JNDI Name Resolver
Field | Type | Default Value  
---|---|---  
Context Factory  
Jndi Initial Factory  
Jndi Provider Properties  
Jndi Provider Url  
## See Also
  *