Handle croned and scheduled events with messaging queues
632
A Go service that provides event execution with SQLite and RabbitMQ. The service consumes events from a queue, stores them in a SQLite database, and produces events to appropriate queues. It uses a cron job that runs every minute to auto-execute scheduled events. This allows efficient, scalable and extensible delayed event execution.
go-eventual is designed to:
Pull this image
Setup the environment variables such as:
# Database
DB_PATH=/app/data
# RabbitMQ
RABBITMQ_USER=
RABBITMQ_PASSWORD=
RABBITMQ_HOST=
RABBITMQ_PORT=5672
RABBITMQ_VHOST=/
RABBITMQ_QUEUE=eventual
docker run --env-file .env sauloopez/go-eventual:1.0
Events should be sent to RabbitMQ in JSON format with the following structure:
{
"Message": "Event content to be published",
"ExpectedAt": "2025-05-01",
"Exchange": "target_exchange",
"Days": [1,2,3],
"ExpectedClock": "15:30",
"Times": 1
}
Where:
Message: The content that will be published when the event is executed (required)ExpectedAt: The specific date for event execution (format: YYYY-MM-DD) (or ExpectedClock)Exchange: The RabbitMQ exchange to publish to (required)Days: Days of week (1-7, where 1 is Monday)ExpectedClock: Time of day for execution (format: HH:MM)Times: Number of times to execute the event, must be one with ExpectedAt, -1 for every and natural number major to 0. (default: 1)Contribute to my repo here.
Contributions are welcome! Please feel free to submit a Pull Request.
Content type
Image
Digest
sha256:7aacd41db…
Size
11.4 MB
Last updated
9 months ago
docker pull sauloopez/go-eventual