# MQTT Consumer

**MQTT** is a lightweight, publish-subscribe, machine to machine network protocol for message queue/message queuing service. It is designed for connections with remote locations that have devices with resource constraints or limited network bandwidth, such as in the Internet of Things.

All component configurations are classified broadly into the following sections:

* ​[​Basic Information​](../component-base-configuration)​
* Meta Information
* [Resource Configuration​](../resource-configuration)​
* ​[Connection Validation](https://docs.bdb.ai/7.6/data-pipeline/components/connection-validation)​

{% hint style="info" %}
_Follow the given demonstration to configure the MQTT component._
{% endhint %}

{% embed url="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2FYpzdXlZRcmxyYiycBH5L%2FMQTT%20consumer%20(online-video-cutter.com).mp4?alt=media&token=81e3c0f3-a0b8-45d0-939c-d9bb5621f26b" %}
_MQTT Consumer configuration_
{% endembed %}

**Configuring the Meta Information tab of the MQTT Consumer component:**

* **Host IP Address**: Provide the IP Address of MQTT broker.
* **Username:** Enter the username.
* **Port**: Enter the port for the given IP address.
* **Authenticator**: There are 2 options in it, select any one to authenticate.
  * **Password**: Enter the password to authenticate.
  * **PEM/PPK File**: Upload the PEM/PPK File to authenticate.
* Quality of service(QoS): Enter the values either _**0, 1 or 2**_. The **Quality of Service** (QoS) level is an agreement between the sender of a message and the receiver of a message that defines the guarantee of delivery for a specific message. There are 3 QoS levels in MQTT:
  1. **At most once (0):** The minimal QoS level is zero. This service level guarantees a best-effort delivery. There is no guarantee of delivery. The recipient does not acknowledge receipt of the message and the message is not stored and re-transmitted by the sender.
  2. **At least once (1):** QoS level 1 guarantees that a message is delivered at least one time to the receiver. The sender stores the message until it gets a PUBACK packet from the receiver that acknowledges receipt of the message.&#x20;
  3. **Exactly once (2):** QoS 2 is the highest level of service in MQTT. This level guarantees that each message is received only once by the intended recipients. QoS 2 is the safest and slowest quality of service level. The guarantee is provided by at least two request/response flows (a four-part handshake) between the sender and the receiver. The sender and receiver use the packet identifier of the original PUBLISH message to coordinate delivery of the message.
* **MQTT topic:** Enter the name of MQTT from where the messages has to be consumed.

<figure><img src="https://363587200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fuq3RSHHup7fjHYaspk7y%2Fuploads%2F7NQTbImDS6DvH7ucZkkt%2Fimage.png?alt=media&#x26;token=53edcaae-1afa-4066-a786-6232c3b87ddd" alt=""><figcaption><p>Meta information tab of the MQTT consumer</p></figcaption></figure>

{% hint style="info" %}
_<mark style="color:green;">Please Note</mark>: Kindly perform the following tasks to run a Pipleline workflow with the MQTT consumer component:_

* _After configuring the component click the **Save Component in Storage** option for the component._&#x20;
* _Update the Pipeline workflow and activate the pipeline to  see the MQTT consumer working in a Pipeline Workflow. The user can get details through the Logs panel when the Pipeline workflow starts loading data._
{% endhint %}
