Skip to content

feat(consumer): expose Connected() for connection-state health checks - #29

Merged
lzambarda merged 2 commits into
masterfrom
feat/consumer-connection-state
Jul 15, 2026
Merged

lzambarda merged 2 commits into
masterfrom
feat/consumer-connection-state

Conversation

@pascal-blokur

Copy link
Copy Markdown
Contributor

Add a lock-free atomic connection-state flag to Consumer and expose it via a new Connected() accessor. The flag is set true after a successful connection/reconnection and flipped false the instant the broker connection drops (before any lock is taken) and on Close.

This lets callers register liveness/readiness health checks that reflect the consumer's own connection to the broker, so an orchestrator can restart a pod whose consumer has lost its connection and failed to reconnect. Reading the flag never blocks, so it is safe to poll from a health check even while the reconnection path holds the internal mutex.

pascal-blokur and others added 2 commits July 15, 2026 10:29
Add a lock-free atomic connection-state flag to Consumer and expose it via
a new Connected() accessor. The flag is set true after a successful
connection/reconnection and flipped false the instant the broker connection
drops (before any lock is taken) and on Close.

This lets callers register liveness/readiness health checks that reflect the
consumer's own connection to the broker, so an orchestrator can restart a pod
whose consumer has lost its connection and failed to reconnect. Reading the
flag never blocks, so it is safe to poll from a health check even while the
reconnection path holds the internal mutex.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
govulncheck flags GO-2026-5856 in crypto/tls@go1.26.4 (fixed in go1.26.5),
which fails the CI lint job. Bump the go directive so CI builds with the fixed
standard library.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lzambarda
lzambarda merged commit 5ddf662 into master Jul 15, 2026
2 checks passed
@lzambarda
lzambarda deleted the feat/consumer-connection-state branch July 15, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants