Designing Messaging and Event Architectures: Queues, Topics, Events, Streaming and Delivery Guarantees

Microsoft Azure Architect Design AZ 301 55 min min read Updated: Nov 17, 2026 Advanced
Designing Messaging and Event Architectures: Queues, Topics, Events, Streaming and Delivery Guarantees
Advanced Topic 1 of 3

Three Kinds of Messages

KindMeaningExampleService
Command / messagePlease do this. One receiver, must be processedProcessPaymentService Bus queue
EventThis happened. Many possible receiversBlobCreatedEvent Grid, Service Bus topic
StreamLarge ordered flow of events for analysisTelemetryEvent Hubs

Decision Table

NeedChoose
Reliable work queue with retries and dead-letteringService Bus queue
Fan-out to many subscribers with filtersService Bus topic or Event Grid
React to Azure resource changesEvent Grid
Millions of events per second, replay, Kafka clientsEvent Hubs
Simple, huge, cheap queue, over 80 GB, no advanced featuresStorage Queue
Ordering per customerService Bus sessions or Event Hubs partition key

Delivery Guarantees

  • Most services give at-least-once delivery. A message can arrive more than once
  • At-most-once (do not retry) can lose messages
  • Exactly-once processing is built by you using idempotent handlers or deduplication

Design Rules

  1. Make consumers idempotent: use a message id and upsert or check a processed-ids table
  2. Set max delivery count and a dead-letter queue, and alert when it is not empty
  3. Use time-to-live so old messages expire
  4. Use competing consumers: many workers read one queue and scale by queue length
  5. Keep messages small. Store big payloads in Blob and send a claim check reference
  6. Use sessions or partition keys only when ordering is required, because they limit parallelism
  7. Use the outbox pattern so database changes and messages do not diverge

Patterns

PatternIdea
Queue-based load levelingQueue absorbs spikes so backend processes at steady pace
Competing consumersParallel workers share a queue
Publish/subscribeTopic copies a message to each subscription
Priority queueSeparate queues or topics for urgent work
SagaLong business transaction across services using events and compensations
Claim checkSend a pointer to large data

Security and Networking

  • Entra ID and managed identities instead of connection strings
  • Premium Service Bus for private endpoints, bigger messages and dedicated capacity
  • Geo-disaster recovery pairing for namespaces. Check geo-replication features and current options

Scenario

Order system: web app puts an OrderPlaced message on a Service Bus topic. Subscriptions for billing, inventory and email each get a copy. Billing uses a session per customer for ordering. Failed messages go to dead-letter and raise an alert. Warehouse devices stream scans to Event Hubs for analytics.

Practice

  1. Classify five interactions as command, event or stream
  2. Design an idempotent payment handler
  3. Choose the service for 50,000 messages per second of telemetry

Conclusion

Pick the messaging service by message kind. Assume at-least-once delivery, make handlers idempotent, handle poison messages with dead-letter queues and use patterns such as competing consumers and claim check.

Quick Summary: kinds; decisions; guarantees; rules; patterns; security; scenario.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators