AZ-204 Azure Messaging & Event-driven Solutions 2 — Questions and Answers
Question 1: What is the key difference between an Azure Service Bus queue and a topic?
- Queues support multiple publishers while topics support only one publisher
- Topics support multiple subscriptions allowing multiple consumers to receive copies of each message, while queues deliver each message to exactly one consumer (Correct answer)
- Queues have higher throughput limits than topics
- Topics only support AMQP while queues support both HTTP and AMQP
Correct answer: Topics support multiple subscriptions allowing multiple consumers to receive copies of each message, while queues deliver each message to exactly one consumer
Topics implement a publish-subscribe pattern where multiple subscriptions each receive a copy of every message, while queues implement point-to-point delivery where each message goes to exactly one consumer.
Question 2: Which Azure SDK method should you call to settle a received Service Bus message and confirm it was successfully processed, preventing redelivery?
- DeleteMessageAsync()
- CompleteMessageAsync() (Correct answer)
- AcknowledgeMessageAsync()
- RemoveMessageAsync()
Correct answer: CompleteMessageAsync()
CompleteMessageAsync() settles a received Service Bus message, removing it from the queue or subscription and preventing it from being redelivered to another consumer.
Question 3: What is the purpose of Azure Event Hubs Capture?
- To filter incoming events based on property rules
- To automatically archive streaming data to Azure Blob Storage or Azure Data Lake Storage (Correct answer)
- To create point-in-time snapshots of partition state
- To replicate events to a secondary Event Hubs namespace
Correct answer: To automatically archive streaming data to Azure Blob Storage or Azure Data Lake Storage
Event Hubs Capture automatically captures streaming data and persists it to Azure Blob Storage or Azure Data Lake Storage for batch processing or long-term analytics without requiring additional code.
Question 4: Which Service Bus feature allows you to atomically send or receive messages across multiple queues and topics in a single all-or-nothing operation?
- Message batching
- Transactions (Correct answer)
- Message sessions
- Scheduled delivery
Correct answer: Transactions
Azure Service Bus supports transactions that enable atomic operations across multiple messaging entities, ensuring all operations either succeed or fail together.
Question 5: In Azure Event Hubs, what happens when events are published with the same partition key?
- They are distributed randomly to balance load across partitions
- A hash of the partition key routes all matching events consistently to the same partition (Correct answer)
- They are stored in a dedicated partition named after the key
- The SDK selects a partition based on current availability
Correct answer: A hash of the partition key routes all matching events consistently to the same partition
When a partition key is specified, Event Hubs hashes the key to consistently route events with the same key to the same partition, ensuring ordered delivery for related events.
Question 6: How does Azure Event Grid handle event delivery failures to a subscriber endpoint?
- Events are permanently lost after the first delivery failure
- Event Grid uses exponential backoff retries for up to 24 hours and supports optional dead-lettering to a storage account (Correct answer)
- Event Grid retries exactly 3 times with a fixed 30-second delay between attempts
- Events are stored in a temporary queue for 1 hour before being discarded
Correct answer: Event Grid uses exponential backoff retries for up to 24 hours and supports optional dead-lettering to a storage account
Event Grid retries failed deliveries using exponential backoff for up to 24 hours (configurable TTL) and supports dead-lettering undeliverable events to an Azure Storage account.
Question 7: Which C# class in the Azure.Messaging.ServiceBus SDK is used to send messages to a Service Bus queue or topic?
- ServiceBusClient
- ServiceBusSender (Correct answer)
- ServiceBusProcessor
- ServiceBusReceiver
Correct answer: ServiceBusSender
ServiceBusSender is the class used to send messages to a Service Bus queue or topic, created by calling ServiceBusClient.CreateSender() with the target queue or topic name.
What is the key difference between an Azure Service Bus queue and a topic?