Question

Difficulty: MediumImplement Azure Service Bus Solutions

An airline baggage tracking application uses an Azure Service Bus queue named `baggage-scans` to process scan events. You need to configure the queue and the receiver client to meet the following requirements:
1. Duplicate scan messages sent within a 10-minute window must be automatically discarded by the queue.
2. If a receiver application fails to process a scan event, the message must remain in the queue to be retried.
3. If processing a scan event fails 5 times, the message must be automatically routed to the dead-letter queue.

Which two configurations or actions should you implement? (Select two.)

  1. Enable duplicate detection on the queue and set the duplicate detection history time window to 10 minutes.Answer
  2. Set the queue's maximum delivery count to 5 and receive messages using PeekLock mode.Answer
  3. C
    Set the queue's maximum delivery count to 5 and receive messages using ReceiveAndDelete mode.
  4. D
    Configure a Shared Access Signature (SAS) token with Manage, Send, and Listen permissions at the namespace level to authenticate the receiver client.
  5. E
    Configure the client application to retrieve the Service Bus connection string from Azure Key Vault using a managed identity that has only Secret Set and Secret List permissions on the key vault.

Answer

To meet the requirements, you should enable duplicate detection on the queue with a 10-minute history time window, and configure the queue's maximum delivery count to 5 while using PeekLock mode in the receiver application.
Enabling duplicate detection with a 10-minute history window allows Azure Service Bus to drop duplicate messages sent within that time frame. Using PeekLock mode allows the system to retry processing if a failure occurs, and setting the maximum delivery count to 5 automatically dead-letters the message after 5 unsuccessful attempts.

Step-by-Step Solution

1
Configure duplicate detection.
Enable duplicate detection on the Service Bus queue and configure the duplicate detection history time window to 10 minutes.
This automatically filters out duplicate messages with the same MessageId within the specified window.
2
Select correct receive mode.
Configure the receiver client application to use PeekLock mode.
PeekLock receives messages in a two-stage operation, allowing retries if processing fails, unlike ReceiveAndDelete which deletes them immediately.
3
Configure delivery retry limit.
Set the queue's maximum delivery count to 5.
When PeekLock is used, Service Bus increments the delivery count each time a message is locked and not completed. Reaching the limit of 5 automatically routes the message to the dead-letter queue.

Key Concept

Azure Service Bus message reliability, duplicate detection, and receive modes
Rate this question