Sidecar service that consumes user settings update messages from the Twake Workplace common-settings RabbitMQ exchange and applies the changes to Meet's PostgreSQL database.
- Subscribes to the
settingstopic exchange on RabbitMQ with routing keyuser.settings.updated. - For each message, matches the user by
payload.email(case-insensitive) and runs:UPDATE meet_user SET language = COALESCE($1, language), timezone = COALESCE($2, timezone), updated_at = NOW() WHERE email ILIKE $3
- Only
languageandtimezoneare synced.languageis mapped from ISO 639-1 (en,fr, ...) to Django'sLANGUAGEScodes (en-us,fr-fr,nl-nl,de-de). - Unknown users (never logged into Meet) are skipped silently.
- The service holds no state. Re-applying the same payload is a no-op; the queue's natural ordering plus a single consumer make replays safe.
All configuration is via environment variables. See .env.example for defaults.
| Variable | Required | Default | Purpose |
|---|---|---|---|
RABBITMQ_URL |
yes | — | AMQP DSN |
RABBITMQ_EXCHANGE |
no | settings |
Topic exchange to bind to |
RABBITMQ_ROUTING_KEY |
no | user.settings.updated |
Binding key |
RABBITMQ_QUEUE |
no | meet.user_settings |
Consumer queue name |
RABBITMQ_PREFETCH |
no | 1 |
QoS prefetch count |
DATABASE_URL |
yes | — | PostgreSQL DSN for the Meet database |
MEET_USER_TABLE |
no | meet_user |
User table override (defensive) |
LANGUAGE_MAP_OVERRIDES |
no | {} |
JSON map of additional ISO → Django language codes |
LOG_LEVEL |
no | info |
pino log level |
HEALTH_PORT |
no | 8080 |
HTTP port for probes and metrics |
SHUTDOWN_TIMEOUT_MS |
no | 10000 |
Grace period on SIGTERM |
The Postgres role used by the service should be granted only SELECT, UPDATE (language, timezone, updated_at) ON meet_user. No INSERT or DELETE is performed.
| Path | Purpose |
|---|---|
GET /healthz |
Liveness: returns 200 while the process is alive |
GET /readyz |
Readiness: 200 once the consumer is connected and the database responds to SELECT 1 |
GET /metrics |
Prometheus metrics (process metrics + mcs_messages_processed_total{outcome=...}, mcs_message_latency_seconds, mcs_db_errors_total) |
npm install
cp .env.example .env # then edit
npm run devTests:
npm run test:unit # fast, no docker
npm run test:integration # requires docker (testcontainers)
npm test # both- docs/architecture.md — what the service does, message flow, design rationale.
- docs/operations.md — provisioning dependencies, monitoring, alerting, troubleshooting.
- docs/development.md — local setup, tests, releasing.
- docs/running-locally.md — end-to-end smoke test against Docker postgres + rabbitmq.