From 4c5051049d643d543265eb487b0255efc4a3fb54 Mon Sep 17 00:00:00 2001 From: Julian Cuni Date: Fri, 1 May 2026 11:18:56 +0200 Subject: [PATCH] Add Redis telemetry stream configuration for tcp-ingestion and processor services --- .env.example | 5 +++++ compose.yaml | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/.env.example b/.env.example index e82ac0f..f27604b 100644 --- a/.env.example +++ b/.env.example @@ -55,5 +55,10 @@ PROCESSOR_INSTANCE_ID=processor-1 # Shared # --------------------------------------------------------------------- +# Redis Stream name carrying normalized Position records from +# tcp-ingestion to processor. Both services must use the same value. +# Override only if migrating to a new stream (e.g. for multi-vendor). +REDIS_TELEMETRY_STREAM=telemetry:teltonika + # pino log level: fatal | error | warn | info | debug | trace LOG_LEVEL=info diff --git a/compose.yaml b/compose.yaml index b7bfccd..c010259 100644 --- a/compose.yaml +++ b/compose.yaml @@ -53,6 +53,10 @@ services: NODE_ENV: production INSTANCE_ID: ${TCP_INGESTION_INSTANCE_ID:-stage-1} REDIS_URL: redis://redis:6379 + # Pinned explicitly here to keep tcp-ingestion and processor in sync; + # neither service's compiled default is authoritative — the deploy + # stack is the single source of truth for the stream name. + REDIS_TELEMETRY_STREAM: ${REDIS_TELEMETRY_STREAM:-telemetry:teltonika} LOG_LEVEL: ${LOG_LEVEL:-info} restart: unless-stopped @@ -102,6 +106,9 @@ services: NODE_ENV: production INSTANCE_ID: ${PROCESSOR_INSTANCE_ID:-processor-1} REDIS_URL: redis://redis:6379 + # Must match tcp-ingestion's REDIS_TELEMETRY_STREAM — both pinned + # to the same shared variable so they cannot drift. + REDIS_TELEMETRY_STREAM: ${REDIS_TELEMETRY_STREAM:-telemetry:teltonika} POSTGRES_URL: postgres://${POSTGRES_USER:-trm}:${POSTGRES_PASSWORD:-trm-pilot-change-me}@postgres:5432/${POSTGRES_DB:-trm} LOG_LEVEL: ${LOG_LEVEL:-info} restart: unless-stopped