Implement Phase 1 task 1.8 (Redis Streams publisher + main wiring)
- Bounded in-memory queue (default 10000); overflow throws PublishOverflowError so the framing layer skips ACK and the device retransmits. - Background worker drains via XADD with MAXLEN ~ approximate trimming. - JSON serialization with sentinel encoding for bigint/Buffer/Date; correctly handles Buffer.prototype.toJSON firing before the replacer. - AdapterContext.publish(position, codec) with codec-label closure at dispatch in adapters/teltonika/index.ts; zero changes to the three codec parsers. - connectRedis with retry-on-startup; main.ts wires the full pipeline. - installGracefulShutdown stubbed (full hardening in task 1.12). - 19 new tests (17 unit + 2 Docker-conditional integration). Total 81 passing.
This commit is contained in:
@@ -19,6 +19,9 @@ const ConfigSchema = z.object({
|
||||
// Observability
|
||||
METRICS_PORT: z.coerce.number().int().min(0).max(65535).default(9090),
|
||||
|
||||
// Publisher queue — capacity of the bounded in-memory queue before overflow
|
||||
PUBLISH_QUEUE_CAPACITY: z.coerce.number().int().min(1).default(10_000),
|
||||
|
||||
// Device authority — off by default; opt-in for strict reject-on-unknown
|
||||
STRICT_DEVICE_AUTH: z
|
||||
.string()
|
||||
|
||||
Reference in New Issue
Block a user