---
title: t Paho and Paho MQTT 5
description: Available triggers
documentId: ipaas-paho-paho5-trigger
locale: en-US
---

## Paho

The [**Paho**](https://camel.apache.org/components/4.10.x/paho-component.html) component enables integration of applications with the MQTT protocol (version 3), facilitating communication between devices and systems in Internet of Things (IoT) environments.

<Callout type="important" title="IMPORTANT">
- Supports connection to external MQTT brokers to publish messages and subscribe to topics.
- Integrations **cannot** be used as an MQTT broker (only as a client).
- Compatible with MQTT protocol versions 3.1.1 and 3.1.
</Callout>

**URI Syntax**: `paho:topic`

### Main fields

*Path parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|---------------|------------|----------|
| `topic` (common) | (required) Topic name. | —  | String |


*Query parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|---------------|------------|----------|
| `brokerUrl` (common) | The MQTT broker URL. | tcp://localhost:1883 | String |

### Example

<Steps>
<Step>
The flow connects to the public MQTT broker (`test.mosquitto.org`) on port 1883 using the TCP protocol.
</Step>
<Step>
It subscribes to the topic named `sensedia-01` and waits for messages published to this topic.
</Step>
<Step>
When a message is received, the content (`${body}`) is logged with the message "Got message" followed by the message body.
</Step>
</Steps>

```yaml
- from:
    uri: "paho:sensedia-01"
    parameters:
      brokerUrl: tcp://test.mosquitto.org:1883
    steps:
    - log:
        message: "Got message ${body}"
```

![](https://creative-ball-51b3fc85c0.media.strapiapp.com/paho_trigger_fb503fc8e9.png)


#### Result

![](https://creative-ball-51b3fc85c0.media.strapiapp.com/paho_message_e0c737e627.png)

```
[1] 2024-08-27 13:06:12,021 INFO  [io.quarkus] (main) Installed features: [camel-bean, camel-cloudevents, camel-core, camel-k-core, camel-k-runtime, camel-knative, camel-kubernetes, camel-paho, camel-yaml-dsl, cdi, kubernetes-client, smallrye-context-propagation, vertx]
[1] 2024-08-27 13:07:05,282 INFO  [mai.yaml:6] (MQTT Call: camel-paho14635917155488) Got message Hello World
```

## Paho MQTT5

The [**Paho MQTT5**](https://camel.apache.org/components/4.10.x/paho-mqtt5-component.html) component enables integration of applications with the MQTT protocol (version 5), offering advanced messaging features such as persistent sessions and flow control.

<Callout type="important" title="IMPORTANT">
- Supports connection to external MQTT brokers to publish messages and subscribe to topics.
- Integrations **cannot** be used as an MQTT broker (only as a client).
- Compatible with MQTT protocol version 5.
</Callout>

**URI Syntax**: `paho-mqtt5:topic`

### Main fields

*Path parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|---------------|------------|----------|
| `topic` (common) | (required) Topic name. | —  | String |


*Query parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|---------------|------------|----------|
| `brokerUrl` (common) | The MQTT broker URL. | tcp://localhost:1883 | String |


### Example

The flow in the example is identical to the flow described for the **Paho** component, with the difference that this one uses **version 5** of the MQTT protocol.

<Steps>
<Step>
The flow connects to the public MQTT broker (`test.mosquitto.org`) on port 1883 using the TCP protocol.
</Step>
<Step>
It subscribes to the topic named `sensedia-01` and waits for messages published to this topic.
</Step>
<Step>
When a message is received, the content (`${body}`) is logged with the message "Got message" followed by the message body.
</Step>
</Steps>

```yaml
- from:
    uri: "paho-mqtt5:sensedia-01"
    parameters:
      brokerUrl: tcp://test.mosquitto.org:1883
    steps:
    - log:
        message: "Got message ${body}"
```

![](https://creative-ball-51b3fc85c0.media.strapiapp.com/paho_mqtt5_trigger_597700afc2.png)


#### Result

![](https://creative-ball-51b3fc85c0.media.strapiapp.com/paho_mqtt5_mensagem_a695797f0b.png)

````
[1] 2024-08-27 13:06:12,021 INFO  [io.quarkus] (main) Installed features: [camel-bean, camel-cloudevents, camel-core, camel-k-core, camel-k-runtime, camel-knative, camel-kubernetes, camel-paho, camel-yaml-dsl, cdi, kubernetes-client, smallrye-context-propagation, vertx]
[1] 2024-08-27 13:07:05,282 INFO  [mai.yaml:6] (MQTT Call: camel-paho14635917155488) Got message Hello World

````
