Runnable examples that show EZRA in action. Each directory starts a full stack with Docker Compose: an EZRA server, a producer that pushes tasks, and one or more workers that process them.
Prerequisite: Docker with Compose v2 (docker compose version).
# pick an example
cd python # or: cd node
# start EZRA, push tasks, and run a worker - all in one
docker compose up --buildThe producer runs once and exits. The worker processes tasks as they arrive, then idles out after 30 s with no new work.
To push another batch without restarting everything:
docker compose run --rm producerdocker compose up --build --scale worker=3Run the producer again. Three workers compete for tasks - each task goes to exactly one worker. The hostname prefix in the logs shows who processed what.
The producer pushes 50 tasks. Each task has a simulated duration (0.1-10 s, log-uniform) so most finish quickly but a few take longer. About 3% of tasks are marked will_fail, which causes the worker to nack them. After max_attempts (default 3) the task lands in the dead-letter queue.
| variable | default | effect |
|---|---|---|
TASK_COUNT |
50 | number of tasks the producer pushes |
NACK_MODE |
immediate |
immediate - xdel, task retries right away; deferred - skip nack, EZRA reclaims after visibility_timeout seconds |
IDLE_TIMEOUT |
30 | seconds a worker waits with no tasks before exiting |
EZRA_QUEUE |
tasks |
queue name |
Pass them inline or set in a .env file before starting:
TASK_COUNT=200 docker compose up --build