Skip to content

Simple tool to schedule MQTT messages.

License

Notifications You must be signed in to change notification settings

DanNixon/mqtt-actor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mqtt-actor

CI dependency status

Simple tool to schedule MQTT messages.

Rather handy for driving event schedule announcements and other similar tasks.

Usage

TL;DR: see mqtt-actor --help and the examples.

A "script" is generated from several script fragments, see examples for some examples. Script fragments are discovered recursively in the script directory, any file (or directory) not starting with . and ending with .txt is considered to be an enabled script fragment. The general format is as such: [timestamp] [delimiter] [topic] [delimiter] [message].

[delimiter] defaults to the pipe (|), but can be configured via the command line options.

[timestamp] can be either an absolute timestamp, in either RFC2822 or RFC3339 format or a relative timestamp. Relative timestamps are relative to the last message in the current file, unless it is the first message in the file, in which case it is relative to the time the script was loaded. The actor watches the script source directory and will reload the script when it detects that a script source file might have changed.

Deployment

For testing and small/temporary deployments, Podman (or Docker if you really must) can be used:

podman run \
  --rm -it \
  -e RUST_LOG=debug \
  -e MQTT_BROKER=broker.hivemq.com \
  -v ./examples/:/config \
  ghcr.io/dannixon/mqtt-actor:main

For more serious deployments, Kubernetes is a better option.