Messaging Patterns
Asynchronous communication primitives for decoupling services and ensuring reliable message delivery.
// concept
Messaging enables services to communicate without tight coupling. Producers emit messages; consumers process them. The challenge: choosing the right delivery guarantees, ordering, and failure handling.
In-Memory Queue
FIFO queue for decoupling producers and consumers. Simple async communication within a single process.
Pub/Sub Broker
Publishers emit events to topics, subscribers receive matching messages. Decouples producers from consumers.
At-Most-Once
Fire and forget delivery. Messages may be lost but are never duplicated. Lowest latency guarantee.
At-Least-Once
Retry until acknowledged. Messages are never lost but may be delivered multiple times.
Dead Letter Queue
Route failed messages to a separate queue for inspection. Prevents poison messages from blocking processing.
Consumer Groups
Distribute partitions across consumers in a group. Enables parallel processing with load balancing.
Partitioned Log
Kafka-style append-only log split into partitions. Ordered within partition, parallel across partitions.