MQTT worker
Do the Fly.io setup first.
Devices
MQTT
devices/+/readings
MQTT broker
subscribe
worker Machine
buffer, 10 s
commit
Tigris bucket
lake/
Devices publish JSON readings to devices/<device id>/readings on an MQTT broker: a hosted one, or one you run, for example Mosquitto in another Fly app. The worker process subscribes over TLS, takes the device id from the topic, and appends every 10 seconds, like HTTP intake, buffered. For a broker in the same Fly organization, connect over the private network instead (its .internal or .flycast address); change the port and drop tls_set() if that broker doesn't use TLS.
fly secrets set --app $APP MQTT_HOST="<broker host>" MQTT_USERNAME="<user>" MQTT_PASSWORD="<password>"The client acknowledges each message when it arrives, so readings waiting in the buffer are lost on a crash, as in HTTP intake, buffered. Try it with any MQTT client, such as Mosquitto's:
mosquitto_pub -h "<broker host>" -p 8883 -u "<user>" -P "<password>" -t devices/pump-1/readings \
-m '{"time": "2026-01-05T10:05:00Z", "temp": 62.0, "humidity": 41}'