Documentation
¶
Overview ¶
Package topics reconciles the bridge's elected topic list against what its consumer is actually subscribed to.
The gap this closes is a quiet one. A customer joins a topic in the portal; the broker projects it and the edge picks it up on its next snapshot poll, with no converge and no restart. The bridge's `-topics` is a PROCESS FLAG and does not follow. So the plane starts delivering a topic the bridge then discards, and every component reports itself healthy: the election is live, the edge joined the band, the frames arrive here, and the objects die one hop before they would have been useful.
At runtime that shows up as a rising unknown_topic counter, which an alert watches. This is the same fact one step earlier, at startup, where an operator who just restarted the unit is actually looking.
It WARNS AND CONTINUES, never refuses. Refusing would turn a customer's topic join into a bridge that will not start, which is a worse outage than a topic that is not bridged: the un-bridged topic loses one topic's objects, the refusal loses all of them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Diff ¶
type Diff struct {
// Subscribed but NOT bridged. These objects arrive and are discarded.
// This is the direction that loses data.
Missing []string
// Bridged but NOT subscribed. Harmless: nothing is delivered for them, so
// the flag is merely wider than the election. Reported anyway, because it
// is usually a leftover from a topic somebody left and it makes the flag
// misleading to read.
Extra []string
// AllTopics reports the aggregator posture, in which the consumer receives
// every topic on the plane and no finite -topics list can match it.
AllTopics bool
}
Diff is what the bridge carries versus what its consumer is subscribed to.
func Compare ¶
Compare diffs the bridge's own names against the consumer's projected ids.
It compares IDS, not names, because ids are what the broker actually projects and what the edge filters on. Comparing names would agree with a broker that had renamed a topic under the same id, which is precisely the case worth catching.
type Subscription ¶
Subscription is the slice of a consumer record this check reads.
func Fetch ¶
func Fetch(ctx context.Context, base, consumerID, token string, hc *http.Client) (Subscription, error)
Fetch reads one consumer's projected subscription from the broker's state API.
Read-only and best-effort by design: every failure here is reported to the caller and none of them is fatal, because a bridge that refused to start when the broker was briefly unreachable would convert a control-plane blip into a data-plane outage.