> For the complete documentation index, see [llms.txt](https://doc.sysdevmobile.com/kalipso/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.sysdevmobile.com/kalipso/documentation/actions/group-communications/mqtt-subscribe.md).

# MQTT Subscribe

Subscribe to a topic on an MQTT broker using a connection previously opened with **MQTT Connect**. Incoming messages for the subscribed topic are handled in the **MQTT Message received** event.

Action available for the following operating systems:

<figure><img src="https://1614058754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ5vDGuBZwhJDeu5Rq7Wt%2Fuploads%2Fgit-blob-7a7ab3f3fc74afcaab1e0810f419316203cc49e1%2F01_Supported_OS.png?alt=media" alt="OS Supported: Android, iOS, Win, Win32"><figcaption></figcaption></figure>

<figure><img src="https://1614058754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ5vDGuBZwhJDeu5Rq7Wt%2Fuploads%2FAhXoBNAjC5GXXCieBvFs%2Fimage.png?alt=media&amp;token=a88b23ad-581f-453b-b80d-8af2c5665be3" alt=""><figcaption></figcaption></figure>

## Parameters

* **MQTT ID** *\<numeric> -* The identifier of the MQTT connection to use. This must match the **Target MQTT ID** used in **MQTT Connect**.
* **Topic** *\<string> -* The topic to subscribe to. Wildcards are supported:
  * `+` - matches a single topic level (e.g. `sensors/+/temperature`).
  * `#` - matches any number of topic levels and must be the last character (e.g. `sensors/#`).
* **Quality of Service** *\<unquoted string> -* The maximum QoS level the broker will use to deliver messages for this subscription:
  * **At most once** (QoS 0) - Messages are delivered at most once. No acknowledgment.
  * **At least once** (QoS 1) - Messages are delivered at least once. Duplicates are possible.
  * **Exactly once** (QoS 2) - Messages are delivered exactly once. Slowest but guarantees no loss or duplication.

{% hint style="info" %}
When a message is received for a subscribed topic, the **MQTT Message received** event is triggered and the target variables defined in **MQTT Connect** (**Target Notification MQTT ID**, **Target Notification Topic** and **Target Notification Payload**) are updated with the message details.
{% endhint %}
