D4 · Infrastructure

Messaging and Events

Guaranteed question on the AZ-305: Storage Queue vs vs vs . The key is distinguishing messages (commands with per-unit value) from events (notifications) and streams (massive telemetry).

Messages vs events — the distinction

Message (command)

  • •"Process THIS order" — the producer expects processing
  • •The payload IS the complete data
  • •Cannot be lost; order and transactions can matter
  • •→ Service Bus / Storage Queues

Event (notification)

  • •"Something HAPPENED" (blob created, VM deleted)
  • •Lightweight payload: a reference to the fact
  • •The producer doesn't know or care who reacts
  • •→ Event Grid

Stream (telemetry)

  • •Millions of events/second in a continuous flow
  • •The value is in the AGGREGATE, not each event
  • •Consumers re-read using offsets
  • •→ Event Hubs

📨Árbol de decisión — Mensajería y Eventos

Storage Queue · Service Bus · Event Grid · Event Hubs

Interactivo

Pregunta 1

¿Qué patrón de comunicación necesitas?

💡 La distinción fundamental: mensajes = comandos con procesamiento garantizado por unidad. Eventos = notificaciones "algo ocurrió". Streams = telemetría masiva re-leíble.

The 4 services compared

ServiceParadigmDifferentiatorsAnti-case
Storage QueuesSimple queueCheap, up to 500 TB, 64 KB messages. No ordering or duplicate detectionFIFO, transactions, pub/sub
Service BusEnterprise queues/topicsFIFO (sessions), dedup, transactions, DLQ, pub/sub topics, AMQP. Premium: zones + VNetMassive telemetry (expensive per message)
Event GridDiscrete push eventsReactive routing of events from Azure services and custom sources; filters; push to handlers (Functions, webhooks); MQTT broker for IoTLarge payloads, guaranteed work-queue semantics
Event HubsStreaming (partitioned log)Millions of events/s, re-readable retention, consumer groups, Kafka-compatible, Capture to storageIndividual commands requiring guaranteed per-unit processing

Service Bus in depth

Features the exam calls out

  • • Sessions: guaranteed FIFO per session ("process each customer's messages in order")
  • • Duplicate detection: discards resends within a time window
  • • Dead-letter queue: poison messages set aside automatically
  • • Topics + subscriptions: pub/sub with per-subscription filters
  • • Scheduled delivery, deferral, auto-forwarding

Receive modes and tiers

  • • Peek-lock (at-least-once with lock and complete/abandon) vs receive-and-delete (at-most-once)
  • • Standard (multi-tenant) vs Premium: dedicated Messaging Units, zone-redundancy, private endpoints, 100 MB messages, geo-DR
Icon-integration-206

Event Grid in depth

Sources and handlers

  • • Sources: Storage (blob created), Resource Groups (resource created/deleted), Key Vault (cert expiring), Event Hubs, custom topics, partner events (SAP, Auth0)
  • • Handlers: Functions, Logic Apps, webhooks, Service Bus, Event Hubs, Storage Queues
  • • Filters by event type and subject — you only receive what matters

Guarantees

  • • At-least-once push with 24h retries + dead-lettering to storage
  • • Classic pattern: blob uploaded → Event Grid → Function processes it (reactive, no polling)
  • • "Audit every resource created in the subscription" → Event Grid on the resource group/subscription

Combined patterns (very exam-relevant)

The services COMBINE: Event Grid notifies "new blob" → Function processes it → writes a command to Service Bus → workers process it with load leveling. Or Event Hubs ingests telemetry → Stream Analytics aggregates → Event Grid triggers alerts. They aren't mutually exclusive.

Decision table

The scenario says...Answer
Orders processed exactly in order per customerService Bus with sessions (FIFO)
Remove duplicate messages from sender retriesService Bus duplicate detection
One order notifies billing, shipping and CRM at onceService Bus topic with 3 subscriptions
A simple, cheap queue to decouple, >80 GBStorage Queues
Trigger a Function when a blob is uploadedEvent Grid → Function
React to Azure resource creation/deletionEvent Grid (resource events)
1M IoT telemetry events/sEvent Hubs
Kafka apps with no rewriteEvent Hubs (Kafka endpoint)
Several teams re-read the same stream at their own paceEvent Hubs consumer groups
Messaging with network isolation and zonesService Bus Premium + private endpoints

Did you get this topic?

Test what you just learned

An order system requires: (1) each customer's orders must be processed in the exact order they were sent, (2) client retries must not produce duplicate orders, (3) orders that fail repeatedly must be set aside for analysis without blocking the queue. Which service meets all three requirements?

Ready to test "Messaging and Events"?

Put what you learned to the test with original AZ-305 exam questions.

Start AZ-305 mock exam

Unlimited mock exams with the Pro plan

Log in to track your progress.