---
schema_version: "1"
id: 5193e080678bf3dbdc23660cac6e869ffbbf49f67c636c01cbb998989fd8ecfd
title: Anypoint MQ Connector 3.x — Mule 4
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/anypoint-mq-connector/3.x/index.md
canonical_url: https://docs.mulesoft.com/anypoint-mq-connector/3.x/
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 0cd00279713f1c558a10b2b3dcdf1fd5c844c49dbc48a1def99100a249d9264a
description: MuleSoft Documentation Site
release: 3.x
latest: false
---
---
product: Anypoint MQ Connector
version: 3.x
---

# Anypoint MQ Connector 3.x — Mule 4

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

Support Category: Select

The Anypoint MQ connector provides publish-subscribe messaging to Mule apps using the Anypoint MQ
cloud service.

Anypoint MQ supports a wide range of messaging use cases, such as enterprise messaging patterns,
asynchronous communications between microservices, and IoT. Anypoint MQ also has a REST API for
publishing or consuming messages using frameworks such as node.js, Java, Go, and DevOps bash
scripts.

## Requirements

To use this connector, you should be familiar with Anypoint Studio, Anypoint Connectors, and
application flows. The Anypoint MQ connector is free, but connecting to the service in Anypoint
Platform requires a license.

### Compatibility

<table><colgroup><col> <col></colgroup><thead><tr><th>Software</th><th>Version</th></tr></thead><tbody><tr><td><p>Mule runtime engine</p></td><td><p>4.1.1 and later</p></td></tr><tr><td><p>Anypoint Studio</p></td><td><p>7 and later</p></td></tr></tbody></table>

This documentation applies to Anypoint MQ connector 3.x only. To migrate from version 2.x to the
version 3.x, see the [Anypoint MQ Connector 3.x Migration Guide](https://docs.mulesoft.com/anypoint-mq-connector/3.x/anypoint-mq-new-3x-major).

## Install Anypoint MQ Connector

You can use this connector with apps written in Anypoint Studio, standalone apps, or apps written in
XML.

In Anypoint Studio:

1.  Create or open a Mule project.

2.  Click the **Exchange** icon in the Studio task bar.

3.  Enter your Anypoint Platform username and password and click **Sign in**.

4.  Select **All assets** and search for "MQ".

5.  Select "Anypoint MQ Connector - Mule 4", and click **Add to project**.

6.  Follow the prompts to install the connector.

For standalone apps or apps written in XML:

1.  Open your Mule project in Anypoint Studio.

2.  Add the connector as a dependency in the pom.xml file:

    ```xml
    <dependency>
      <groupId>com.mulesoft.connectors</groupId>
      <artifactId>anypoint-mq-connector</artifactId>
      <version>x.x.x</version>
      <classifier>mule-plugin</classifier>
    </dependency>
    ```

Replace `x.x.x` with the version that corresponds to the connector you are using.

To obtain the most up-to-date `pom.xml` file information, access the connector in
[Anypoint Exchange](https://www.mulesoft.com/exchange/) and click **Dependency Snippets**.

## Configure an Operation in a Mule Project

In Anypoint Studio:

1.  Install the connector, if it’s not already installed. See
    [Install Anypoint MQ Connector](#install-anypoint-mq-connector).

2.  Create or open a Mule project.

3.  Search for "mq" in the **Mule Palette**.

4.  Click **Anypoint MQ** to see the available operations for the connector.

    ![Anypoint MQ Mule Palette](/mulesoft/current/en-us/anypoint-mq-connector/3.x/_images/amq-3x-connector-palette.png)

5.  Configure the operation accordingly.

    <table><colgroup><col> <col></colgroup><thead><tr><th>Operation</th><th>Description</th></tr></thead><tbody><tr><td><p><a href="https://docs.mulesoft.com/anypoint-mq-connector/3.x/anypoint-mq-ack">ACK</a></p></td><td><p>Indicates that the message has been consumed correctly and deletes the message from In Flight status.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/anypoint-mq-connector/3.x/anypoint-mq-consume">Consume</a></p></td><td><p>Consumes messages from a queue.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/anypoint-mq-connector/3.x/anypoint-mq-ack">NACK</a></p></td><td><p>Changes the status of the message from In Flight to In Queue to be consumed again by an available consumer.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/anypoint-mq-connector/3.x/anypoint-mq-publish">Publish</a></p></td><td><p>Publishes messages to a destination.</p></td></tr><tr><td><p><a href="https://docs.mulesoft.com/anypoint-mq-connector/3.x/anypoint-mq-listener">Subscriber</a></p></td><td><p>Listens for messages from a queue.</p></td></tr></tbody></table>

### Configure the Connection to the Default Subscriber

For each operation, you must configure a connection to a subscriber.

In Anypoint Studio:

1.  Drag the name of the operation from the **Mule Palette** to the canvas, and then select it.

2.  Click the green plus sign to the right of **Connector configuration**.

3.  In Anypoint Platform, click **MQ > Destinations**.

4.  Copy the URL for your region to the **URL** field in Studio.

5.  In Anypoint Platform, click **MQ > Client Apps**.

6.  If needed, create a client app.

7.  Copy the **Client App ID** value from Anypoint Platform to the **Client App ID** field in
    Studio.

8.  Copy the **Client Secret** value from Anypoint Platform to the **Client Secret** field in
    Studio.

9.  Click **Test Connection** to verify the Anypoint MQ Default subscriber.

10. Click **OK**.

## See Also

- [Tutorial: Create a Queue and Send Messages to It](https://docs.mulesoft.com/mq/mq-tutorial)

- [Anypoint MQ Connector Reference](https://docs.mulesoft.com/anypoint-mq-connector/3.x/anypoint-mq-connector-reference)

- [Anypoint MQ Overview](https://docs.mulesoft.com/mq/)

- [FAQ: Anypoint MQ](https://docs.mulesoft.com/mq/mq-faq)

- [Anypoint MQ REST APIs](https://docs.mulesoft.com/mq/mq-apis)

- [Anypoint MQ Connector in Anypoint Exchange](https://anypoint.mulesoft.com/exchange/com.mulesoft.connectors/anypoint-mq-connector/)

- [Anypoint MQ Connector Release Notes for Mule 4](https://docs.mulesoft.com/release-notes/connector/anypoint-mq-connector-release-notes-mule-4)
