feat: implement event bus backend configuration for DB and NATS

This commit is contained in:
2026-05-10 17:55:51 +02:00
parent dca50b46d1
commit c2a5541706
7 changed files with 109 additions and 42 deletions

View File

@@ -91,10 +91,9 @@ ALLOW_REGISTRATION=true # set to false to disable new sign-ups
SECURE_COOKIES=true # set when serving over HTTPS
RUST_LOG=presentation=info,tower_http=info,worker=info,application=info
# Event bus — background poster sync runs in the worker binary.
# Default: DB queue (uses the same database, no extra infrastructure).
# Set NATS_URL to use NATS instead (JetStream recommended for at-least-once delivery).
# NATS_URL=nats://localhost:4222
# Event bus — "db" (default, uses same database) or "nats"
EVENT_BUS_BACKEND=db
# NATS_URL=nats://localhost:4222 # required when EVENT_BUS_BACKEND=nats
```
The `worker` binary must run alongside `presentation` to process events: