MQTT Notification Settings

This page documents settings for configuring an MQTT service as a target for Bucket Notifications. See Publish Events to MQTT for a tutorial on using these settings.

You can establish or modify settings by defining:

  • an environment variable on the host system prior to starting or restarting the Buckit Server. Refer to your operating system’s documentation for how to define an environment variable.

  • a configuration setting using bm admin config set.

If you define both an environment variable and the similar configuration setting, Buckit uses the environment variable value.

Some settings have only an environment variable or a configuration setting, but not both.

Important

Each configuration setting controls fundamental Buckit behavior and functionality. Buckit strongly recommends testing configuration changes in a lower environment, such as DEV or QA, before applying to production.

Multiple MQTT Targets

You can specify multiple MQTT service endpoints by appending a unique identifier _ID for each set of related MQTT settings to the top level key. For example, the following commands set two distinct MQTT service endpoints as PRIMARY and SECONDARY, respectively:

export MINIO_NOTIFY_MQTT_ENABLE_PRIMARY="on"
export MINIO_NOTIFY_MQTT_BROKER_PRIMARY="tcp://user:password@mqtt-endpoint.example.net:1883"

export MINIO_NOTIFY_MQTT_ENABLE_SECONDARY="on"
export MINIO_NOTIFY_MQTT_BROKER_SECONDARY="tcp://user:password@mqtt-endpoint.example.net:1883"
bm admin config set notify_mqtt:primary \
   broker="tcp://endpoint:port" \
   topic="minio/bucket-name/events/" \
   username="username" \
   password="password" \
   [ARGUMENT="VALUE"] ... \

bm admin config set notify_mqtt:secondary \
   broker="tcp://endpoint:port" \
   topic="minio/bucket-name/events/" \
   username="username" \
   password="password" \
   [ARGUMENT="VALUE"] ... \

With these settings, MINIO_NOTIFY_MQTT_ENABLE_PRIMARY indicates the environment variable is associated to an MQTT service endpoint with an ID of PRIMARY.

Settings

Enable

Required

MINIO_NOTIFY_MQTT_ENABLE

Specify on to enable publishing bucket notifications to an MQTT endpoint.

Defaults to off.

notify_mqtt

The top-level configuration key for defining an MQTT server/broker endpoint for use with Buckit bucket notifications.

Use bm admin config set to set or update an MQTT server/broker endpoint. The following arguments are required for each endpoint:

  • broker

  • topic

  • username Optional if MQTT server/broker does not enforce authentication/authorization

  • password Optional if MQTT server/broker does not enforce authentication/authorization

Specify additional optional arguments as a whitespace (" ")-delimited list.

bm admin config set notify_mqtt \
   broker="tcp://endpoint:port" \
   topic="minio/bucket-name/events/" \
   username="username" \
   password="password" \
   [ARGUMENT="VALUE"] ... \

Broker

Required

MINIO_NOTIFY_MQTT_BROKER
notify_mqtt broker

Specify the MQTT server/broker endpoint. Buckit supports TCP, TLS, or Websocket connections to the server/broker URL. For example:

  • tcp://mqtt.example.net:1883

  • tls://mqtt.example.net:1883

  • ws://mqtt.example.net:1883

Topic

Required

MINIO_NOTIFY_MQTT_TOPIC
notify_mqtt topic

Specify the name of the MQTT topic to associate with events published by Buckit to the MQTT endpoint.

Username

Required if the MQTT server/broker enforces authentication/authorization

MINIO_NOTIFY_MQTT_USERNAME
notify_mqtt username

Specify the MQTT username Buckit should use to authenticate to the MQTT server/broker.

Password

Required if the MQTT server/broker enforces authentication/authorization

MINIO_NOTIFY_MQTT_PASSWORD
notify_mqtt password

Specify the password for the MQTT username Buckit uses to authenticate to the MQTT server/broker.

Quality of Service

Optional

MINIO_NOTIFY_MQTT_QOS
notify_mqtt qos

Specify the Quality of Service priority for the published events.

Defaults to 0.

Keep Alive Interval

Optional

MINIO_NOTIFY_MQTT_KEEP_ALIVE_INTERVAL
notify_mqtt keep_alive_interval

Specify the keep-alive interval for the MQTT connections. Buckit supports the following units of time measurement:

  • s - seconds, “60s”

  • m - minutes, “60m”

  • h - hours, “24h”

  • d - days, “7d”

Reconnect Interval

Optional

MINIO_NOTIFY_MQTT_RECONNECT_INTERVAL
notify_mqtt reconnect_interval

Specify the reconnect interval for the MQTT connections. Buckit supports the following units of time measurement:

  • s - seconds, “60s”

  • m - minutes, “60m”

  • h - hours, “24h”

  • d - days, “7d”

Queue Directory

Optional

MINIO_NOTIFY_MQTT_QUEUE_DIR
notify_mqtt queue_dir

Specify the directory path to enable Buckit’s persistent event store for undelivered messages, such as /opt/minio/events.

Buckit stores undelivered events in the specified store while the MQTT server/broker is offline and replays the stored events when connectivity resumes.

Queue Limit

Optional

MINIO_NOTIFY_MQTT_QUEUE_LIMIT
notify_mqtt queue_limit

Specify the maximum limit for undelivered messages. Defaults to 100000.

Comment

Optional

MINIO_NOTIFY_MQTT_COMMENT
notify_mqtt comment

Specify a comment to associate with the MQTT configuration.