Skip to content
← All posts

Metering that bills once, even when the bus delivers twice

Idempotency keys on every meter event, because a durable queue that replays is normal, and double-billing is not.

Bill once

A durable event bus delivers at least once, which means it sometimes delivers twice. Every meter event carries an idempotency key computed from its own content, so a replay folds into the same roll-up rather than counting again.

The invoice is the sum of the rows, and the rows cannot double.