ADR: Resilient client (NATS-style reconnect)
Это содержимое пока не доступно на вашем языке.
Status
Section titled “Status”Accepted — implemented in pkg/client/resilience.
Context
Section titled “Context”Chronacta gRPC clients previously relied on application code copying dialWithRetry from docs/examples. Event-store products often document Polly-style manual retry. NATS clients reconnect transparently at the connection layer.
Decision
Section titled “Decision”Introduce pkg/client/resilience with:
ResilientClient: long-lived connection, infinite reconnect with backoff (defaultMaxReconnects = -1,ReconnectWait = 1s), gRPC keepalive.LiveSubscription: auto-resubscribe transient streams from last delivered position after stream or transport errors.DurableWorker: pull/ack loop with reconnect pause; checkpoint remains on the server.
Append auto-retry is enabled only when IdempotencyKey is set (same semantics as idempotent append on the server).
Low-level client.Dial remains available for tests and minimal tools.
Consequences
Section titled “Consequences”- Applications call
resilience.Connectonce at startup. - Docs and examples use resilience as the primary path; copied
dialWithRetryis legacy. - REST/TypeScript/Python clients are unchanged (no durable subscription surface).
Related
Section titled “Related”- Go SDK
- NATS bridge (server-side reconnect pattern)
- Duplicate policy

