Pub/Sub Patterns
Decouple services with event-driven messaging. This recipe covers topic-based routing, dead-letter queues, and exactly-once delivery guarantees using Meridian's built-in broker.
Topic Declaration
Define durable topics with configurable retention and partitioning. Each topic maps to a logical channel; subscribers bind via push or pull models.
Fan-Out Delivery
A single published message fans out to every active subscription. Use subscription filters to route only relevant payloads to each consumer group.
Dead-Letter Handling
Messages that exceed retry thresholds land in a per-subscription DLQ. Inspect, replay, or purge them without losing visibility.
Exactly-Once Semantics
Enable idempotency keys and transactional outboxes to prevent duplicate processing. Meridian deduplicates within a configurable window per message ID.
Next step: Event Sourcing Recipe — persist every state change as an immutable event stream.