# MQTT

Kubemq MQTT source provides a MQTT subscriber for processing MQTT's messages.

## Prerequisites

The following are required to run events source connector:

* kubemq cluster
* kubemq-sources deployment
* MQTT Broker

## Configuration

MQTT source connector configuration properties:

| Properties Key   | Required | Description                                | Example          |
| ---------------- | -------- | ------------------------------------------ | ---------------- |
| host             | yes      | mqtt connection host                       | "localhost:1883" |
| topic            | yes      | set mqtt subscription topic                | "queue"          |
| dynamic\_mapping | yes      | set if to map mqtt topic to kubemq channel | "true"           |
| username         | no       | set mqtt username                          | "username"       |
| password         | no       | set mqtt password                          | "password"       |
| client\_id       | no       | mqtt connection string address             | "client\_id"     |
| qos              | no       | set mqtt subscription QoS                  | "0"              |

Example:

```yaml
bindings:
  - name: mqtt-kubemq-event
    source:
      kind: messaging.mqtt
      name: mqtt-source
      properties:
        host: "localhost:1883"
        dynamic_map: "true"
        topic: "queue"
        username: "username"
        password: "password"
        client_id: "client_id"
        qos: "0"
    target:
      kind: kubemq.events
      name: target-kubemq-events
      properties:
        address: "kubemq-cluster:50000"
        client_id: "kubemq-http-connector"
        channel: "events.mqtt"
    properties:
      log_level: "info"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kubemq.io/configuration/connectors/kubemq-sources/messaging/mqtt.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
