Contact Us 1-800-596-4880

Anypoint MQ Connector Reference - Mule 4

Support Version: Select

Anypoint MQ Connector Version 3.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

Name

String

Specifies the name for this configuration. Connectors refer to the configuration by using this name.

x

Connection

Specifies the connection types to provide to this configuration.

x

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

URL

String

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

String

The Client App ID from Anypoint Platform > MQ > Client Apps

x

Client Secret

String

The Client Secret field from Anypoint Platform > MQ > Client Apps

x

TLS Context

Tls

Host

String

Destination host for proxy requests

Port

Number

Destination port for proxy requests

Username

String

Username to authenticate against the proxy

Password

String

Password to authenticate against the proxy

Send Buffer Size

Number

Size of the buffer (in bytes) used when sending data, set on the socket itself

Receive Buffer Size

Number

Size of the buffer (in bytes) used when receiving data

Client Timeout

Number

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

Boolean

If set, transmitted data is not grouped but sent immediately. Defaults to true.

true

Linger

Number

SO_LINGER value, which determines how long (in milliseconds) the socket takes to close so that any remaining data is transmitted correctly

Keep Alive

Boolean

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.

false

Connection Timeout

Number

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.

30000

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

Ack

<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

String

Name of the configuration to use

x

Ack Token

String

Acknowledgment token used to perform manual ACK and NACK operations, in MANUAL mode only

x

Reconnection Strategy

Retry strategy in case of connectivity errors

Anypoint MQ Connector doesn’t support this parameter. For more information, see Can I use a retry strategy with the Anypoint MQ connector?

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

String

Name of the configuration to use

x

Queue

String

Queue or Exchange name from which to fetch a message

x

Acknowledgment Mode

Enumeration, one of:

  • IMMEDIATE

  • MANUAL

Acknowledgment mode to use for the messages retrieved

IMMEDIATE

Acknowledgment Timeout

Number

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.

0

Acknowledgment Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit to use in the acknowledgmentTimeout configuration

MILLISECONDS

Polling Time

Number

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.

10000

Polling Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit to use in the pollingTime configuration

MILLISECONDS

Output Mime Type

String

MIME type of the operation output

Output Encoding

String

Encoding of the operation output

Streaming Strategy

Use repeatable streams

Target Variable

String

Name of a variable to store the operation’s output

Target Value

String

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

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors

Anypoint MQ Connector doesn’t support this parameter. For more information, see Can I use a retry strategy with the Anypoint MQ connector?

Output

Type

Binary

Attributes Type

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

String

Name of the configuration to use

x

Ack Token

String

Acknowledgment token used to perform manual ACK and NACK operations, in MANUAL mode only

x

Reconnection Strategy

Retry strategy in case of connectivity errors

Anypoint MQ Connector doesn’t support this parameter. For more information, see Can I use a retry strategy with the Anypoint MQ connector?

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

String

Name of the configuration to use

x

Destination

String

Queue or Exchange name from which to fetch a message

x

Output Mime Type

String

MIME type of the operation output

Output Encoding

String

The encoding of the operation output

Streaming Strategy

Use repeatable streams

Body

Binary

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

Object

Custom user properties set to the message

Message Id

String

Valid custom user ID for the outgoing message. If not specified, the broker creates one.

Message Group Id

String

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

Number

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

Boolean

Set to true if the body type should be sent as an Anypoint MQ Message property

true

Target Variable

String

Name of a variable to store the operation output

Target Value

String

Expression to evaluate against the operation output. The expression outcome is stored in the target variable

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors

Anypoint MQ Connector doesn’t support this parameter. For more information, see Can I use a retry strategy with the Anypoint MQ connector?

Output

Type

Binary

Attributes Type

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

String

Name of the configuration to use

x

Queue

String

Name of the queue from which messages are retrieved

x

Subscriber Type

One of:

Strategy to use when subscribing to messages from the service

Acknowledgment Mode

Enumeration, one of:

  • IMMEDIATE

  • AUTO

  • MANUAL

Acknowledgment mode to use for the messages retrieved

AUTO

Acknowledgment Timeout

Number

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

  • DAYS

Time unit to use in the acknowledgmentTimeout configuration

MILLISECONDS

Circuit Breaker

Output Mime Type

String

MIME type of the operation output

Output Encoding

String

Encoding of the operation output

Primary Node Only

Boolean

Whether this source should only be executed on the primary node when running in a cluster

Streaming Strategy

Use repeatable streams

Redelivery Policy

Message redelivery policy

Reconnection Strategy

Retry strategy in case of connectivity errors

Anypoint MQ Connector doesn’t support this parameter. For more information, see Can I use a retry strategy with the Anypoint MQ connector?

Output

Type

Binary

Attributes Type

For Configurations

Types

Tls

Field Type Description Default Value Required

Enabled Protocols

String

Comma-separated list of protocols enabled for this context

Enabled Cipher Suites

String

Comma-separated list of cipher suites enabled for this context

Trust Store

Key Store

Revocation Check

Trust Store

Field Type Description Default Value Required

Path

String

Location of the trust store, resolved relative to the current classpath and file system, if possible

Password

String

Password used to protect the trust store

Type

String

Type of store used

Algorithm

String

Algorithm used by the trust store

Insecure

Boolean

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

Path

String

Location of the key store, resolved relative to the current classpath and file system, if possible

Type

String

Type of store used

Alias

String

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

String

Password used to protect the private key

Password

String

Password used to protect the key store

Algorithm

String

Algorithm used by the key store

Standard Revocation Check

Field Type Description Default Value Required

Only End Entities

Boolean

Verifies only the last element in the certificate chain

Prefer Crls

Boolean

Uses CRL-signing certificates before using OCSP-signing certificate

No Fallback

Boolean

Doesn’t use the secondary checking method (the one not selected for Prefer Crls)

Soft Fail

Boolean

Avoids verification failure when the revocation server cannot be reached or is busy

Custom OCSP Responder

Field Type Description Default Value Required

Url

String

URL of the OCSP responder

Cert Alias

String

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

String

Path to the CRL file

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 deployment connectivity test to each connector fails.

Reconnection Strategy

Reconnection strategy to use

Anypoint MQ Connector doesn’t support this parameter. For more information, see Can I use a retry strategy with the Anypoint MQ connector?

Reconnect

Anypoint MQ Connector doesn’t support this parameter. For more information, see Can I use a retry strategy with the Anypoint MQ connector?
Field Type Description Default Value Required

Frequency

Number

How often to reconnect, in milliseconds

Count

Number

How many reconnection attempts to make

blocking

Boolean

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

true

Reconnect Forever

Anypoint MQ Connector doesn’t support this parameter. For more information, see Can I use a retry strategy with the Anypoint MQ connector?
Field Type Description Default Value Required

Frequency

Number

How often to reconnect, in milliseconds

blocking

Boolean

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

true

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

Anypoint MQ Message Attributes

Field Type Description Default Value Required

Destination

String

Message destination

x

Headers

Object

Message headers

x

Properties

Object

Message properties

x

Message Id

String

ID of the message

x

Delivery Count

Number

Number of times the message was delivered

x

Content Type

String

Content type of the message body

Ack Token

String

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

String

Error types that equal failure of the circuit when they occur during flow execution. By default, all errors result in failure.

Errors Threshold

Number

Of the errors considered by the circuit, how many must occur for the circuit to be opened.

x

Trip Timeout

Number

How long the circuit remains open after errorsThreshold is reached

x

Trip Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

The time unit bound to the tripTimeout value

MILLISECONDS

Repeatable In Memory Stream

Field Type Description Default Value Required

Initial Buffer Size

Number

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

Number

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

Number

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:

  • BYTE

  • KB

  • MB

  • GB

Unit in which all these attributes are expressed

Repeatable File Store Stream

Field Type Description Default Value Required

Max In Memory Size

Number

Maximum amount of memory that the stream can hold locally before content is buffered to disk

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

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

String

ID of the message that was published

x

Prefetch

Field Type Description Default Value Required

Max Local Messages

Number

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.

30

Polling

Field Type Description Default Value Required

Fetch size

Number

The maximum number of messages (1-10) to fetch on each polling execution

An error occurs if you configure a value greater than 10.

10

Scheduling Strategy

scheduling-strategy

Scheduling strategy for triggering the message fetch from the service

x

Fixed Frequency

Field Type Description Default Value Required

Frequency

Number

Polling frequency

1000ms

(1 second)

Start delay

Number

The amount of time for the scheduler to wait before starting

10

Time unit

Enumeration, one of:

  • DAYS

  • HOURS

  • MINUTES

  • SECONDS

  • MILLISECONDS

Time unit to use in the startDelay configuration

MILLISECONDS

Cron

Field Type Description Default Value Required

Expression

Cron expression

x

Time Zone

String

The ID of the time zone in which the expression is based

View on GitHub