Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dannixon/mqtt-actor
Simple tool to schedule MQTT messages.
https://github.com/dannixon/mqtt-actor
mqtt
Last synced: 7 days ago
JSON representation
Simple tool to schedule MQTT messages.
- Host: GitHub
- URL: https://github.com/dannixon/mqtt-actor
- Owner: DanNixon
- License: mit
- Created: 2022-02-24T07:36:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-05T09:26:23.000Z (8 months ago)
- Last Synced: 2024-03-05T10:39:43.600Z (8 months ago)
- Topics: mqtt
- Language: Rust
- Homepage:
- Size: 98.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# mqtt-actor
[![CI](https://github.com/DanNixon/mqtt-actor/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/DanNixon/mqtt-actor/actions/workflows/ci.yml)
[![dependency status](https://deps.rs/repo/github/dannixon/mqtt-actor/status.svg)](https://deps.rs/repo/github/dannixon/mqtt-actor)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](./examples).
A "script" is generated from several script fragments, see [examples](./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:
```sh
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.