mqtt

Subscribe to topics on MQTT brokers.

# Common config fields, showing default values
input:
mqtt:
urls:
- tcp://localhost:1883
topics:
- benthos_topic
client_id: benthos_input

Metadata

This input adds the following metadata fields to each message:

- mqtt_duplicate
- mqtt_qos
- mqtt_retained
- mqtt_topic
- mqtt_message_id

You can access these metadata fields using function interpolation.

Fields

urls

A list of URLs to connect to. If an item of the list contains commas it will be expanded into multiple URLs.

Type: array
Default: ["tcp://localhost:1883"]

topics

A list of topics to consume from.

Type: array
Default: ["benthos_topic"]

client_id

An identifier for the client connection.

Type: string
Default: "benthos_input"

qos

The level of delivery guarantee to enforce.

Type: number
Default: 1
Options: 0, 1, 2.

clean_session

Set whether the connection is non-persistent.

Type: bool
Default: true

user

A username to assume for the connection.

Type: string
Default: ""

password

A password to provide for the connection.

Type: string
Default: ""