Event-driven microservices using Azure Service Bus provide loose coupling and reliable message delivery. The patterns for building production-quality event-driven systems on Service Bus are well-established.
Topic subscriptions for fan-out
Azure Service Bus topics with subscriptions provide the publish-subscribe pattern. The OrderService publishes an OrderPlaced message to a topic; the InventoryService, NotificationService, and FulfillmentService each have separate subscriptions. Each service receives every OrderPlaced message independently. Subscription filter rules limit messages to those matching specific properties, a notification subscription that only receives messages for premium customers.
Competing consumers on queues
A Service Bus queue with multiple consumer instances provides competing consumers: messages are delivered to one consumer at a time, enabling parallel processing and horizontal scaling. Each consumer receives a different message from the queue. The lock duration (how long a consumer has to process a message before it becomes available to other consumers) must be set longer than the expected maximum processing time.
Saga with Service Bus
A multi-step saga can be implemented with Service Bus: each saga step publishes a message to the next step's queue on success, or a compensation message to undo previous steps on failure. The saga state machine is distributed across queue messages rather than stored in a central orchestrator. This choreography approach is loosely coupled but difficult to trace and debug, the saga state is implicit in the message flow rather than explicit in an orchestrator.
Retry and dead letter configuration
Service Bus automatic retry delivers messages up to the configured MaxDeliveryCount (default 10) before moving them to the dead letter queue. Configure MaxDeliveryCount based on the expected transient failure rate and recovery time. Monitor dead letter queue depth and alert when it grows, dead-lettered messages represent failed business operations. The dead letter queue reason (MaxDeliveryCountExceeded, TTLExpiredException) guides the remediation approach.