Anypoint MQ Connector Reference | MuleSoft Documentation
# Anypoint MQ Connector Reference
Support Version: Select
Anypoint MQ Connector Version 4.x
Anypoint MQ is a multi-tenant, cloud messaging service that enables customers to perform advanced asynchronous messaging among their applications.
## Configurations
### Config
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Specifies the name for this configuration. Connectors refer to the configuration by using this name.  
Connection | Specifies the connection types to provide to this configuration.  
Expiration Policy |  Expiration Policy | Configures the minimum amount of time that a dynamic configuration instance can remain idle before the runtime considers it eligible for purging. The platform purges expired instances as needed to free resources.  
#### Connection Types
##### Connection
###### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
The region URL for the queue from the **Anypoint Platform > MQ** console | https://mq-us-east-1.anypoint.mulesoft.com/api/v1  
Client App ID |  Value from either:
  * **ID** from **Anypoint Platform** > **Access Management** > **Connected Apps**
  * **Client App ID** from **Anypoint Platform > MQ > Client Apps**

  
Client Secret |  Value from either:
  * **Secret** from **Anypoint Platform** > **Access Management** > **Connected Apps**
  * **Client Secret** from **Anypoint Platform > MQ > Client Apps**

  
Destination host for proxy requests  
Destination port for proxy requests  
Username | Username to authenticate against the proxy  
Password | Password to authenticate against the proxy  
Send Buffer Size | Size of the buffer (in bytes) used when sending data, set on the socket itself  
Receive Buffer Size | Size of the buffer (in bytes) used when receiving data  
Client Timeout | SO_TIMEOUT value on sockets. Indicates the amount of time (in milliseconds) that the socket waits in a blocking operation before failing. A value of 0 (the default) indicates an indefinite wait.  
Send TCP With No Delay | If set, transmitted data is not grouped but sent immediately. Defaults to true.  
SO_LINGER value, which determines how long (in milliseconds) the socket takes to close so that any remaining data is transmitted correctly  
Keep Alive | SO_KEEPALIVE behavior on open sockets, which automatically checks open socket connections that are unused for long periods, and closes them if the connection becomes unavailable. This is a property on the socket itself and is used by a server socket to control whether connections to the server are kept alive before they are recycled.  
Connection Timeout | Number of milliseconds to wait until an outbound connection to a remote server is successfully created, before failing with a timeout. Defaults to 30 seconds.  
Reconnection |  | When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the deployment connectivity test to each connector fails.  
## Operations


### Associated Sources
`<anypoint-mq:ack>`
Executes an acknowledgment indicating that the message is consumed correctly and deletes the message from In Flight status.
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | Name of the configuration to use  
Ack Token | Acknowledgment token used to perform manual ACK and NACK operations, in MANUAL mode only  
Reconnection Strategy | 
  *   * Reconnect Forever

| Retry strategy in case of connectivity errors  
#### For Configurations
#### Throws
  * ANYPOINT-MQ:ACKING
  * ANYPOINT-MQ:CONNECTIVITY
  * ANYPOINT-MQ:DESTINATION_NOT_FOUND
  * ANYPOINT-MQ:RETRY_EXHAUSTED


### Consume
`<anypoint-mq:consume>`
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | Name of the configuration to use  
Queue or Exchange name from which to fetch a message  
Acknowledgment Mode |  Enumeration, one of:
  * IMMEDIATE
  * MANUAL

| Acknowledgment mode to use for the messages retrieved | IMMEDIATE  
Acknowledgment Timeout | Duration that a message is held by a consumer waiting for an acknowledgment or not acknowledgment. After that duration elapses, the message is again available to any consumer.  
Acknowledgment Timeout Unit |  Enumeration, one of:
  * NANOSECONDS
  * MICROSECONDS
  * MILLISECONDS
  * SECONDS
  * MINUTES
  * HOURS

| Time unit to use in the acknowledgmentTimeout configuration | MILLISECONDS  
Polling Time |  Time to wait for a message to be ready for consumption (0-20000).
  * If this value is greater than 0 and no message arrives, the connector throws a `ANYPOINT-MQ:TIMEOUT` exception.
  * If this value is 0 and no message arrives, the connector returns `NULL` and doesn’t throw the `ANYPOINT-MQ:TIMEOUT` exception.

  
Polling Time Unit |  Enumeration, one of:
  * NANOSECONDS
  * MICROSECONDS
  * MILLISECONDS
  * SECONDS
  * MINUTES
  * HOURS

| Time unit to use in the pollingTime configuration | MILLISECONDS  
Output Mime Type | MIME type of the operation output  
Output Encoding | Encoding of the operation output  
Streaming Strategy | 
  * Repeatable In Memory Stream
  * Repeatable File Store Stream
  * non-repeatable-stream

| Use repeatable streams  
Target Variable | Name of a variable to store the operation’s output  
Target Value | Expression to evaluate against the operation’s output and store the expression outcome in the target variable | #[payload]  
Reconnection Strategy | 
  *   * Reconnect Forever

| Retry strategy in case of connectivity errors  
#### Output
Attributes Type |  Anypoint MQ Message Attributes  
---|---  
#### For Configurations
#### Throws
  * ANYPOINT-MQ:ACKING
  * ANYPOINT-MQ:CONSUMING
  * ANYPOINT-MQ:CONNECTIVITY
  * ANYPOINT-MQ:TIMEOUT
  * ANYPOINT-MQ:DESTINATION_NOT_FOUND
  * ANYPOINT-MQ:RETRY_EXHAUSTED


### Nack
`<anypoint-mq:nack>`
Executes a not acknowledgment and changes the status of the message from In Flight to In Queue for subscriber consumption
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | Name of the configuration to use  
Ack Token | Acknowledgment token used to perform manual ACK and NACK operations, in MANUAL mode only  
Reconnection Strategy | 
  *   * Reconnect Forever

| Retry strategy in case of connectivity errors  
#### For Configurations
#### Throws
  * ANYPOINT-MQ:NACKING
  * ANYPOINT-MQ:CONNECTIVITY
  * ANYPOINT-MQ:DESTINATION_NOT_FOUND
  * ANYPOINT-MQ:RETRY_EXHAUSTED


### Publish
`<anypoint-mq:publish>`
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | Name of the configuration to use  
Destination | Queue or Exchange name from which to fetch a message  
Output Mime Type | MIME type of the operation output  
Output Encoding | The encoding of the operation output  
Streaming Strategy | 
  * Repeatable In Memory Stream
  * Repeatable File Store Stream
  * non-repeatable-stream

| Use repeatable streams  
Body of the outgoing message, sent as a string as part of a JSON message. Any content that is published must be capable of being serialized to and deserialized from string format. Sending Objects that don’t have a proper string serialization causes the message to be unreadable on the receiving end. | #[payload]  
User Properties | Custom user properties set to the message  
Message Id | Valid custom user ID for the outgoing message. If not specified, the broker creates one.  
Message Group Id | ID of the message group to which the published message belongs. Specify only for FIFO queues. Message group IDs can contain up to 128 alphanumeric characters (a-z, A-Z, 0-9) and punctuation (! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ ] \ ^ _ ` { } | ~).  
Delivery Delay | Time to postpone delivery of the message before consumption: between 0 and 15 minutes. | MILLISECONDS  
Delivery Delay Unit |  Enumeration |  Time unit to use in the `Delivery Delay` parameter:
  * MILLISECONDS
  * SECONDS
  * MINUTES

| MILLISECONDS  
Send Content-Type | Set to true if the body type should be sent as an Anypoint MQ Message property  
Target Variable | Name of a variable to store the operation output  
Target Value | Expression to evaluate against the operation output. The expression outcome is stored in the target variable | #[payload]  
Reconnection Strategy | 
  *   * Reconnect Forever

| Retry strategy in case of connectivity errors  
#### Output
Attributes Type |  Anypoint MQ Message Publish Attributes  
---|---  
#### For Configurations
#### Throws
  * ANYPOINT-MQ:PUBLISHING
  * ANYPOINT-MQ:CONNECTIVITY
  * ANYPOINT-MQ:ILLEGAL_BODY
  * ANYPOINT-MQ:DESTINATION_NOT_FOUND
  * ANYPOINT-MQ:RETRY_EXHAUSTED
| MILLISECONDS  
Send Content-Type | Set to true if the body type should be sent as an Anypoint MQ Message property  
Target Variable | Name of a variable to store the operation output  
Target Value | Expression to evaluate against the operation output. The expression outcome is stored in the target variable | #[payload]  
Reconnection Strategy | 
  *   * Reconnect Forever

| Retry strategy in case of connectivity errors  
#### Output
Attributes Type |  Anypoint MQ Message Publish Attributes  
---|---  
#### For Configurations
#### Throws
  * ANYPOINT-MQ:PUBLISHING
  * ANYPOINT-MQ:CONNECTIVITY
  * ANYPOINT-MQ:ILLEGAL_BODY
  * ANYPOINT-MQ:DESTINATION_NOT_FOUND
  * ANYPOINT-MQ:RETRY_EXHAUSTED


## Sources
### Subscriber
`<anypoint-mq:subscriber>`
Anypoint MQ Subscriber Message Source retrieves messages from the given destination name.
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | Name of the configuration to use  
Name of the queue from which messages are retrieved  
Subscriber Type |  One of:

| Strategy to use when subscribing to messages from the service  
Acknowledgment Mode |  Enumeration, one of:
  * IMMEDIATE
  * MANUAL

| Acknowledgment mode to use for the messages retrieved  
Acknowledgment Timeout | Duration that a message is held by a broker waiting for an acknowledgment or not acknowledgment before being made available to any subscriber. Specifies the default `acknowledgmentTimeout` value for all Subscriber sources, unless it is overridden. The maximum value of this parameter is 12 hours. | If `acknowledgementTimeout` is not set (the default), the connector uses the TTL value of at least two minutes.  
Acknowledgment Timeout Unit |  Enumeration, one of:
  * NANOSECONDS
  * MICROSECONDS
  * MILLISECONDS
  * SECONDS
  * MINUTES
  * HOURS

| Time unit to use in the acknowledgmentTimeout configuration | MILLISECONDS  
Circuit Breaker |  Circuit Breaker  
Output Mime Type | MIME type of the operation output  
Output Encoding | Encoding of the operation output  
Primary Node Only | Whether this source should only be executed on the primary node when running in a cluster  
Streaming Strategy | 
  * Repeatable In Memory Stream
  * Repeatable File Store Stream
  * non-repeatable-stream

| Use repeatable streams  
Redelivery Policy |  Redelivery Policy | Message redelivery policy  
Reconnection Strategy | 
  *   * Reconnect Forever

| Retry strategy in case of connectivity errors  
#### Output
Attributes Type |  Anypoint MQ Message Attributes  
---|---  
#### For Configurations
## Types
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Enabled Protocols | Comma-separated list of protocols enabled for this context  
Enabled Cipher Suites | Comma-separated list of cipher suites enabled for this context  
Trust Store  
Key Store  
Revocation Check | 
  * Standard Revocation Check
  * Custom OCSP Responder

  
### Trust Store
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Location of the trust store, resolved relative to the current classpath and file system, if possible  
Password | Password used to protect the trust store  
Type of store used  
Algorithm | Algorithm used by the trust store  
Insecure | If true, no certificate validations are performed, rendering connections vulnerable to attacks. Use at your own risk.  
### Key Store
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Location of the key store, resolved relative to the current classpath and file system, if possible  
Type of store used  
When the key store contains many private keys, indicates the alias of the key that is used. If not defined, the first key in the file is used by default.  
Key Password | Password used to protect the private key  
Password | Password used to protect the key store  
Algorithm | Algorithm used by the key store  
### Standard Revocation Check
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Only End Entities | Verifies only the last element in the certificate chain  
Prefer Crls | Uses CRL-signing certificates before using OCSP-signing certificate  
No Fallback | Doesn’t use the secondary checking method (the one not selected for Prefer Crls)  
Soft Fail | Avoids verification failure when the revocation server cannot be reached or is busy  
### Custom OCSP Responder
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
URL of the OCSP responder  
Cert Alias | Alias of the signing certificate for the OCSP response, if present. The signing certificate must be in the trust store.  
### CRL File
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Path to the CRL file  
### Reconnection
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Fails Deployment | When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the deployment connectivity test to each connector fails.  
Reconnection Strategy | 
  *   * Reconnect Forever

| Reconnection strategy to use  
### Reconnect
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Frequency | How often to reconnect, in milliseconds  
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 to reconnect, in milliseconds  
blocking | If false, the reconnection strategy runs in a separate, non-blocking thread  
### Expiration Policy
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Max Idle Time | 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

| A time unit that qualifies the maxIdleTime attribute  
### Anypoint MQ Message Attributes
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Destination | Message destination  
Message headers  
Properties | Message properties  
Message Id | ID of the message  
Delivery Count | Number of times the message was delivered  
Content Type | Content type of the message body  
Ack Token | Acknowledgment token used to perform manual ACK and NACK operations, in MANUAL mode only  
### Circuit Breaker
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
On Error Types | Error types that equal failure of the circuit when they occur during flow execution. By default, all errors result in failure.  
Errors Threshold | Of the errors considered by the circuit, how many must occur for the circuit to be opened.  
Trip Timeout | How long the circuit remains open after `errorsThreshold` is reached  
Trip Timeout Unit |  Enumeration, one of:
  * NANOSECONDS
  * MICROSECONDS
  * MILLISECONDS
  * SECONDS
  * MINUTES
  * HOURS
| A time unit that qualifies the maxIdleTime attribute  
### Anypoint MQ Message Attributes
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Destination | Message destination  
Message headers  
Properties | Message properties  
Message Id | ID of the message  
Delivery Count | Number of times the message was delivered  
Content Type | Content type of the message body  
Ack Token | Acknowledgment token used to perform manual ACK and NACK operations, in MANUAL mode only  
### Circuit Breaker
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
On Error Types | Error types that equal failure of the circuit when they occur during flow execution. By default, all errors result in failure.  
Errors Threshold | Of the errors considered by the circuit, how many must occur for the circuit to be opened.  
Trip Timeout | How long the circuit remains open after `errorsThreshold` is reached  
Trip Timeout Unit |  Enumeration, one of:
  * NANOSECONDS
  * MICROSECONDS
  * MILLISECONDS
  * SECONDS
  * MINUTES
  * HOURS

| The time unit bound to the tripTimeout value | MILLISECONDS  
### Repeatable In Memory Stream
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Initial Buffer Size | The amount of memory allocated to consume the stream and provide random access to it. If the stream contains more data than can fit into this buffer, then the buffer expands according to the bufferSizeIncrement attribute, with an upper limit of maxInMemorySize.  
Buffer Size Increment | How much buffer size can expand. If set to 0 (zero) or less, STREAM_MAXIMUM_SIZE_EXCEEDED is raised when the buffer is full.  
Max Buffer Size | Maximum amount of memory to use before STREAM_MAXIMUM_SIZE_EXCEEDED is raised. If set to 0 (zero) or less, memory is unlimited.  
Buffer Unit |  Enumeration, one of: | Unit in which all these attributes are expressed  
### Repeatable File Store Stream
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Max In Memory Size | Maximum amount of memory that the stream can hold locally before content is buffered to disk  
Buffer Unit |  Enumeration, one of: | Unit in which maxInMemorySize is expressed  
### Redelivery Policy
For information on the redelivery policy, see Configure a Redelivery Policy.
### Anypoint MQ Message Publish Attributes
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Message Id | ID of the message that was published  
### Prefetch
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Max Local Messages | Maximum number of messages to prefetch from the service and keep locally before dispatching to the flow. NOTE: Due to a known issue, using `prefetch` mode with `maxConcurrency="1"` set on the `flow` element might result in message-processing latency. When using `prefetch` mode, set `maxLocalMessages` to a value greater than `1` to avoid message-processing latency issues. When `maxLocalMessages` is set to `1`, latency can occur when the connector prefetches the message but the app doesn’t consume it, and the message returns to the queue for reprocessing.  
### Polling
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Fetch size | The maximum number of messages (1-10) to fetch on each polling execution An error occurs if you configure a value greater than 10.  
Scheduling Strategy |  scheduling-strategy |  Scheduling strategy for triggering the message fetch from the service
  * Fixed Frequency

  
### Fixed Frequency
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Frequency | Polling frequency |  1000ms (1 second)  
Start delay | The amount of time for the scheduler to wait before starting  
Time unit |  Enumeration, one of:
  * HOURS
  * MINUTES
  * SECONDS
  * MILLISECONDS

| Time unit to use in the `startDelay` configuration | MILLISECONDS  
### Cron
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Expression |  Cron expression  
Time Zone | The ID of the time zone in which the expression is based  
## See Also
  *   *