---
schema_version: "1"
id: 004162230fb6daa25330ce177df2a5199dd7460f77cc9d645e9cfd8418a32cbf
title: "FAQ: Anypoint MQ"
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mq/mq-faq.md
canonical_url: https://docs.mulesoft.com/mq/mq-faq
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 1469842e5d8dddf3d8fe7f518c03123a7227f15cc29540426339a773f5cdb28c
description: MuleSoft Documentation Site
latest: true
---
---
product: MQ
---

# FAQ: Anypoint MQ

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

This document lists frequently asked questions about Anypoint MQ.

**See Also:** [Anypoint MQ Connectors](https://docs.mulesoft.com/mq/mq-connectors), [REST APIs](https://docs.mulesoft.com/mq/mq-apis),
[Release Notes](https://docs.mulesoft.com/release-notes/mq/mq-release-notes).

## Why is Anypoint MQ not shown in Anypoint Platform?

Anypoint MQ is an integration add-on to your paid Anypoint Platform package or subscription and
isn’t available in the trial edition of Anypoint Platform.

To add Anypoint MQ to your package or subscription, contact your account team. After adding Anypoint
MQ, wait one hour for Anypoint MQ to become available in Anypoint Platform.

For information about Anypoint Integration packages, see
[MuleSoft Anypoint Platform Pricing](https://www.mulesoft.com/anypoint-pricing).

## In which regions is Anypoint MQ available?

Anypoint MQ standard and FIFO queues are available in these regions:

<table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th>Control Plane</th><th>Geographic Area</th><th>Region</th><th>Region Name</th></tr></thead><tbody><tr><td rowspan="9"><p><a href="https://anypoint.mulesoft.com/">US Cloud</a></p></td><td rowspan="4"><p>North America</p></td><td><p>US East (N. Virginia)</p></td><td><p><code>us-east-1</code></p></td></tr><tr><td><p>US East (Ohio)</p></td><td><p><code>us-east-2</code></p></td></tr><tr><td><p>US West (Oregon)</p></td><td><p><code>us-west-2</code></p></td></tr><tr><td><p>Canada (Montreal)</p></td><td><p><code>ca-central-1</code></p></td></tr><tr><td rowspan="2"><p>Europe</p></td><td><p>Ireland (Dublin)</p></td><td><p><code>eu-west-1</code></p></td></tr><tr><td><p>UK (London)</p></td><td><p><code>eu-west-2</code></p></td></tr><tr><td rowspan="3"><p>Asia Pacific</p></td><td><p>Singapore (Singapore)</p></td><td><p><code>ap-southeast-1</code></p></td></tr><tr><td><p>Australia (Sydney)</p></td><td><p><code>ap-southeast-2</code></p></td></tr><tr><td><p>Japan (Tokyo)</p></td><td><p><code>ap-northeast-1</code></p></td></tr><tr><td rowspan="2"><p><a href="https://eu1.anypoint.mulesoft.com/">EU Cloud</a></p></td><td rowspan="2"><p>Europe</p></td><td><p>Germany (Frankfurt)</p></td><td><p><code>eu-central-1</code></p></td></tr><tr><td><p>Ireland (Dublin)</p></td><td><p><code>eu-west-1</code></p></td></tr><tr><td><p><a href="https://gov.anypoint.mulesoft.com/">MuleSoft Government Cloud</a></p></td><td><p>North America</p></td><td><p>US GovCloud (West)</p></td><td><p><code>us-gov-west-1</code></p></td></tr><tr><td><p><a href="https://ca1.platform.mulesoft.com">Canada Cloud</a></p></td><td><p>North America</p></td><td><p>Canada (Montreal)</p></td><td><p><code>ca-central-1</code> <a href="#mq-hyperforce"><sup><strong>*</strong></sup></a></p></td></tr><tr><td><p><a href="https://jp1.platform.mulesoft.com">Japan Cloud</a></p></td><td><p>Asia Pacific</p></td><td><p>Japan (Tokyo)</p></td><td><p><code>ap-northeast-1</code> <a href="#mq-hyperforce"><sup><strong>*</strong></sup></a></p></td></tr><tr><td><p><a href="https://in1.platform.mulesoft.com">India Cloud</a></p></td><td><p>Asia Pacific</p></td><td><p>India (Mumbai)</p></td><td><p><code>ap-south-1</code> <a href="#mq-hyperforce"><sup><strong>*</strong></sup></a></p></td></tr><tr><td><p><a href="https://au1.platform.mulesoft.com">Australia Cloud</a></p></td><td><p>Asia Pacific</p></td><td><p>Australia (Sydney)</p></td><td><p><code>ap-southeast-2</code> <a href="#mq-hyperforce"><sup><strong>*</strong></sup></a></p></td></tr><tr><td><p><a href="https://gb1.platform.mulesoft.com">United Kingdom Cloud</a></p></td><td><p>Europe</p></td><td><p>United Kingdom (London)</p></td><td><p><code>eu-west-2</code> <a href="#mq-hyperforce"><sup><strong>*</strong></sup></a></p></td></tr></tbody></table>

**\*** You can’t access or configure some Anypoint MQ features, such as client apps and unencrypted
queues. For information, see [Anypoint MQ on Hyperforce](https://docs.mulesoft.com/mq/#mq-on-hyperforce).

## How do I create and send messages into Anypoint MQ from Mule runtime?

After you contact your account team to purchase and activate Anypoint MQ, you can use Anypoint
Platform to create a queue or message exchange, and send messages to it. For more information, see
the [Configuring and Using Queues](https://docs.mulesoft.com/mq/mq-queues) and
[Sending Messages to Multiple Queues Using Message Exchanges](https://docs.mulesoft.com/mq/mq-exchanges).

## How does Anypoint MQ encrypt messages?

Anypoint MQ uses in-flight HTTPS encryption with Transport Layer Security (TLS) 1.2 protocol to
transport messages and doesn’t support the deprecated TLS versions 1.0 and 1.1.

If you configure Anypoint MQ queues for encryption at rest, the payloads are encrypted with the
AES-256 GCM algorithm on the server side.

> [!NOTE] Anypoint MQ encrypts only the message body. Anypoint MQ does not encrypt the `headers` or
> `properties` of messages sent to exchanges and queues.

If your app requires an additional layer of encryption security, then you can encrypt the payloads
yourself before publishing messages to Anypoint MQ. You must manage your encryption keys for both
the message publishers and the consumers.

## Why do I see the message decrypted in the UI for my encrypted queues?

When you have a queue encrypted, the messages are stored encrypted but they are decrypted when they
are read. Encryption and decryption are automatic and transparent to the final user. There’s no
option to disable the automatic decryption. If you need to encrypt the message so that the payload
remains encrypted, manually encrypt the content.

## How can I send a Java Object as a message?

The body of an Anypoint MQ message is sent as a string as part of a JSON message, thus any content
that needs to be published should be serializable in a string format from which you can later
deserialize. One way to do this is to serialize the Java object to its JSON representation using
DataWeave, which can be serialized and deserialized from a string. Sending Java objects that don’t
have a proper string serialization causes the message to be unreadable on the receiving end.

## Can I share messages or queues between regions?

No, queues and message exchanges are unique to the region in which they were created and can’t share
messages or queues between regions. Developers can manually create custom programs that load balance
between regions, but Anypoint MQ itself does not provide multi-region support.

The queues in each region are separate from those in other regions. You can name queues the same in
each region, but queues can’t share messages across regions.

## How does Anypoint MQ pass a correlation ID between publisher and subscriber?

Anypoint MQ doesn’t support propagating `correlationId` from a publisher to a subscriber in the same
way that APIs propagate it from one layer to another.

To pass an ID between publisher and subscriber, add a user property to send with the message. For
information, see [Send a Message to a Queue](https://docs.mulesoft.com/mq/mq-queues#send-a-message-to-a-queue).

For more information about correlation IDs, see
[Total traceability with correlation IDs](https://blogs.mulesoft.com/dev-guides/how-to-tutorials/total-traceability/).

## How many messages can I fetch using the Anypoint MQ user interface?

In **Anypoint Platform** > **MQ** > **Message Browser**, you can fetch up to 50 messages from a
standard (non-FIFO) queue.

For a FIFO queue, the Message Browser UI limits the number of messages you can retrieve to 10. The
FIFO restriction exists because the FIFO queues are limited to 10 in-flight messages per message
group. For more information about in-flight messages, see
[How many in-flight messages can I have per queue?](#inflights)

## Why do I receive fewer messages than my batch size when retrieving messages with the Anypoint MQ REST API?

Anypoint MQ is a highly distributed messaging system, so the results of an API call to receive
messages are not guaranteed to be entirely representative of what is fully in the queue. Anypoint MQ
operates in a best-effort case. For example, if there are 5 messages in a queue, the system returns
anywhere from 0-5 messages in a single API call depending on what distributed subsystems are
accessed by that request. Subsequent API calls retrieve more messages and if you keep making API
requests to receive messages, then you get all of them. Normally in high throughput cases, repeated
API calls happen extremely fast. The Anypoint MQ connector, for example, continuously polls the
Anypoint MQ backend for new messages and from the user perspective, the messages are processed
nearly instantly even though many API calls were used.

## In what order are messages in a standard (non-FIFO) queue?

Standard queues attempt to preserve the order of messages, but strict order is not guaranteed.
Because standard queues are designed to be scalable and distributed, they can’t guarantee that
messages are received in the same order that they are sent. If message order is important, use a
[FIFO queue](https://docs.mulesoft.com/mq/mq-queues#fifoqueues) or set Anypoint MQ Connector to the
[Consume operation](#process-one-by-one).

## Can messages be larger than 10 MB?

Anypoint MQ supports payloads up to 10 MB.

If the payload contains any format except text (such as CSV, HTML, JSON, and XML), Anypoint MQ
converts it to a string before sending, which increases the payload size. This conversion might
result in the payload exceeding the maximum payload size of 10 MB and causing a `Payload too large`
error.

If a larger size is required, you can split the payload into multiple messages, or implement a claim
check style service in which you store the payload in a file system or blob storage, and then put a
pointer to the payload in the message so it can be downloaded later. However, you must manage access
control to the blob storage for both the sender and receiver. You also need to consider that
messages can be received unordered unless you use a FIFO queue.

The **Message Browser** page displays the payload only if the payload size is smaller than 1 MB. If
the payload size is 1 MB or larger, the **Message Browser** page displays an error. In this case,
you can use the Anypoint MQ Broker API to display the message payload. See
[Retrieve a Message](https://docs.mulesoft.com/mq/mq-apis#retrieve-message-api).

## Are message exchanges and queues unique and accessible only in their created environment?

That is, how do we ensure message exchanges or queues created in one environment are not confused or
connected to message exchanges or queues created in a different environment if they have the same
name?

You can have the same object name for queues and exchanges in different environments, but the client
app ID and client secret values must be unique. You can’t access a production queue from a
development environment if they don’t have the corresponding client app IDs.

## How can I restrict access to a queue or message exchange?

You can use **Anypoint Platform** > **Access Management** > **Business Groups or Environments**. The
queues and message exchanges created in a business group or environment are only visible to those
with access to the business group or environment.

Anypoint MQ access is controlled at the environment and business group levels, not per individual
queue or message exchange.

Permissions such as **Destination Publisher** and **Destination Subscriber** are granted at the
environment level and apply to all destinations in that environment.

There is no native mechanism to restrict access to a single queue or message exchange.

## Can I use Anypoint MQ on-premises?

You can publish a message from an on-premises system to Anypoint MQ and have another on-premises
subscriber pull messages from Anypoint MQ. Currently, Anypoint MQ can’t be deployed on-premises. If
you need a messaging source on-premises, you can use Apache Active MQ instead.

## How does Anypoint MQ handle disaster recovery and high availability failover?

Within each region, Anypoint MQ services deploy to multiple availability zones (AZs) to provide high
availability (HA). If service in one availability zone goes down, the Anypoint MQ service operates
normally in that region. If all availability zones go down in a region, the Anypoint MQ service is
unavailable in that region until at least one of the availability zones comes back up. Because the
storage solution for Anypoint MQ is durable, messages that were already in the Anypoint MQ system
before service was interrupted are retained.

Anypoint MQ also provides [cross-region failover](https://docs.mulesoft.com/mq/mq-failover) for standard queues. When you enable
failover for a queue, Anypoint MQ automatically creates a fallback queue in a
[fallback region](https://docs.mulesoft.com/mq/mq-failover#primary-fallback-regions). If a Mule app can’t reach an Anypoint MQ
server in a region, it switches to the fallback queue to publish and consume messages.

## Can I use a retry strategy with the Anypoint MQ connector?

You can’t use reconnection strategies with the Anypoint MQ connector because it does not use a
connection-based protocol. Instead, it uses REST behind the scenes.

On the inbound side, you can easily mimic a retry strategy using a max redelivery attribute set to
your maximum number of retries and an exception strategy to move to a dead-letter queue (DLQ) when
the limit is reached.

On the outbound side, you should use the same triggering mechanism. Otherwise, you can use the
`until-successful` element with this connector.

You should also configure the HTTP connector so that **Global Element Properties** > **Set Max
Redelivery** is set to the value of `-1`.

## How can we replay/reprocess messages from a DLQ?

There is no built-in functionality to replay messages from a DLQ. You must implement a special flow
or app to consume those messages and forward them back to the original queue for reprocessing.

## How do we recover and handle failover?

The network that Anypoint MQ runs on provides high availability replications across its many
datacenters.

## How do we ensure a message is uniquely processed when failover occurs?

If a server fails and failover occurs, messages continue to be processed by other servers on the
network in which Anypoint MQ runs. Standard Anypoint MQ queues do not guarantee only-once message
delivery. Only FIFO queues support only-once message delivery. The high availability network
deduplicates messages for FIFO queues automatically.

## Does Anypoint MQ guarantee message delivery?

Yes. Standard queues provide "at least once" message-delivery reliability for messages routed to
them. For messages published to a standard exchange, the bindings determine which bound queues, if
any, receive each message: a binding with no routing rule receives every message, and a binding with
a routing rule receives only messages that match it. See
[What happens when a message published to an exchange doesn’t match any routing rule?](#unmatched-routing-rules).

## What happens when a message published to an exchange doesn’t match any routing rule?

Bindings without configured message routing rules receive every message published to the exchange.
If every binding has a configured routing rule and a message matches none of them, Anypoint MQ
doesn’t deliver the message to any bound queue.

A successful publish operation confirms that Anypoint MQ accepted the message for the exchange. It
doesn’t confirm that a routing rule matched or that a bound queue received the message. If no bound
queue receives the message, redelivery and dead-letter queue (DLQ) settings configured on queues
don’t apply because the message never enters a queue.

For more information, see
[Route Messages by Configuring Rules on Message Exchanges](https://docs.mulesoft.com/mq/mq-routing-rules).

## How are API requests calculated?

Every API call to Anypoint MQ counts as one API request. Counting each call as a request includes
sending, receiving, and acknowledging messages as well as all operations on queues and exchanges.

Up to 10 messages can be retrieved from a single API call, which only bills as one request. Even if
the request to retrieve messages does not return a message, for example, if the queue is empty, it
still bills as a single API request.

## What’s the maximum TPS for Anypoint MQ?

Maximum transactions per second (TPS):

- Standard queues and exchanges: No maximum TPS

- FIFO queues: Maximum of 300 TPS

  If you batch 10 messages per read and write operation (maximum) using the API, FIFO queues can
  support up to 3,000 TPS.

  For more information about batch operations, see
  [Can I upload and retrieve Anypoint MQ messages in batches?](#batch-upload-retrieve).

> [!IMPORTANT] Failed requests count against TPS.

## What’s the maximum number of queues and exchanges in Anypoint MQ?

There is no maximum number of queues or exchanges.

## How many in-flight messages can I have per queue?

Anypoint MQ supports up to 120,000 in-flight messages per standard (non-FIFO) queue.

FIFO queues allow up to 10 in-flight messages per message group due to the extra processing
required. Anypoint MQ doesn’t limit the number of message groups in a FIFO queue.

A single queue can contain an unlimited number of messages. The maximum duration for any message,
either in-flight or not, is two weeks, after which Anypoint MQ deletes the message.

## Does the Anypoint MQ connector store the message and retry sending it?

The connector does not store the message for resending it. The connector retries 5 times after which
the message is discarded and it becomes the responsibility of the app to decide what to do with a
message.

## Are retries synchronous or asynchronous relative to the Mule flow?

Retries for sending messages to Anypoint MQ broker are always synchronous. By contrast, the client
mode specifies how to establish the connection to the backend and does not govern message-sending
retries.

## Are retries governed by the maxRedelivery setting?

Retries are arbitrary. The `maxRedelivery` parameter indicates how many times the messages were
delivered but not processed (either NACK or TimeOut).

## Can I upload and retrieve Anypoint MQ messages in batches?

Using the Anypoint MQ Broker API, you can batch-upload and batch-retrieve messages from a standard
or FIFO queue. For information, see
[Anypoint MQ Broker API](https://dev-portal.mulesoft.com/apis/anypoint-mq-broker.html).

You can upload or retrieve a maximum of 10 messages (default) in a single call.

For batch-retrieve operations, use the `batchSize` query parameter to specify the number of messages
to retrieve. Anypoint MQ Broker API doesn’t guarantee the number of messages retrieved in a single
call. See
[Why do I receive fewer messages than my batch size when retrieving messages with the Anypoint MQ REST API?](#batchsize).

## Can non-Mule applications interface with Anypoint MQ?

If you have non-Mule applications, you can use the [Anypoint MQ REST APIs](https://docs.mulesoft.com/mq/mq-apis) to send and
receive messages.

## What is the throughput capacity of Anypoint MQ?

Anypoint MQ is horizontally scalable and supports higher throughputs as needed.

## Can I be notified when a message arrives in a queue?

Anypoint MQ provides long polling. You can do a REST request and ask the server to keep the TCP
socket open for up to 20 seconds to fulfill your request if there are not enough messages.

## How can I process messages one at a time?

You can use [FIFO queues](https://docs.mulesoft.com/mq/mq-queues#fifoqueues) to process messages in order.

If you don’t want to use FIFO queues, you can process messages one at a time by setting Anypoint MQ
Connector to the `consume` operation. This operation retrieves a message from the queue or receives
null if a message is not available.

Then, depending on your Mule version:

**Mule 4**

Add the `maxConcurrency="1"` attribute to the `flow` element.

Specify this attribute to set the number of simultaneous invocations that a component can receive at
any given time to 1.

Mule 4 Example:

```xml
<flow name="testanypointmq1by1Flow4" maxConcurrency="1">
    <logger level="INFO" doc:name="Logger" message="Flow triggered" />
    <anypoint-mq:consume doc:name="Anypoint MQ"
       config-ref="Anypoint_MQ_Config"
       destination="queuename" />
       <logger level="INFO" doc:name="Logger" message="Processing message received. #[payload]"/>
    <anypoint-mq:ack
        ackToken="#[vars.currentAckToken]"
        config-ref="Anypoint_MQ_Config"
        doc:name="Anypoint MQ"/>
    <logger doc:name="Logger" level="INFO" message="Message processed."/>
</flow>
```

More than one in-flight message can occur if the processing time between `anypoint-mq:consume` and
`anypoint-mq:ack` is higher than the value of the **Default Acknowledgement Timeout** setting for
the queue.

## Can we see the Anypoint MQ headers in the browse message options?

Anypoint MQ provides direct access to the message ID and payload. You can see the message headers
using the Chrome browser and its Network Inspector feature.

## Does Anypoint MQ connector support shared resources?

The only officially supported connectors and transports for shared resources are HTTP/HTTPS, VM,
JMS, JMS Caching Connection Factory, Database, WMQ, JBoss Transaction Manager, and Bitronix
Transaction Manager.

## How do I create many queues and message exchanges?

You can use a `curl` command with the [Anypoint MQ Admin API](https://docs.mulesoft.com/mq/mq-apis#mq-admin-api) in a `for` loop
to create the number of queues and message exchanges you need. See [Anypoint MQ REST APIs](https://docs.mulesoft.com/mq/mq-apis).

## Do the API requests-per-month usage charges pertain to all environments?

Yes, the usage charges apply to all environments.

## What happens when our usage exceeds our license limit?

If your usage exceeds your license limit, Anypoint MQ continues to work. MuleSoft notifies your
account administrator and team with any billing-related information.

## Why am I seeing 400 bad request errors when using prefetch to receive messages?

When using Anypoint MQ as a message processor with prefetch, use only a global prefetch
configuration.

For example, this local prefetch doesn’t work:

```xml
<anypoint-mq:subscriber config-ref="Anypoint_MQ_Configuration"
    destination="programmatically" doc:name="Anypoint MQ" >
    <anypoint-mq:prefetch fetchSize="50" fetchTimeout="10000"/>
</anypoint-mq:subscriber>
```

Use a global prefetch instead:

```xml
<anypoint-mq:prefetch name="Prefetch_Settings" fetchSize="50"
     fetchTimeout="10000" doc:name="Prefetch Settings"/>
<anypoint-mq:subscriber config-ref="Anypoint_MQ_Configuration"
     destination="programmatically" doc:name="Anypoint MQ"
     prefetch-ref="Prefetch_Settings"/>
```

## How do I delete a queue?

To delete a queue, see [Delete a Queue](https://docs.mulesoft.com/mq/mq-queues#delete-a-queue).

## How do I delete a message exchange?

To delete a message exchange, see
[Delete a Message Exchange](https://docs.mulesoft.com/mq/mq-exchanges#delete-a-message-exchange).

## See Also

- [Knowledge Base Articles](https://help.mulesoft.com/s/knowledge)

- [Apache Active MQ](https://activemq.apache.org/)

- [Rabbit MQ](https://www.rabbitmq.com/)
