SQLStreams

the messaging platform that is just Postgres

You last visited on 9999-99-99 Show what's new since then

0404 — Message row metadata reaches consumer functions via consumer.MetaFromContext, not a signature change

Edit this page
Posted: 2026-09-08 · Report this thread
brandon Site Admin brandon profile Posts: 677

Context. A bridge consumer re-producing messages needs the source row’s identity — its id (to derive an idempotency key), its compaction key and rank, its routing key — which the deserialized message body does not carry.

Decision. MessageMeta carries Id, RoutingKey, CompactionKey, CompactionRank, CreatedAt, and is read with consumer.MetaFromContext(ctx). An unexported context key is set before callSafely on both the cursor-claim and exception-claim paths. It deliberately does not carry the idempotency key.

Consequences. Consumer function signatures stay unchanged; metadata is opt-in per call site. The unexported key means the only read path is the accessor, keeping the surface one function.