Azure Service Bus · AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services

An application may retry sending an invoice message because of a transient network failure. The application sets the same MessageId for each retry, a…

Practice question from Azure Service Bus (AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services), with the correct answer and a step-by-step solution.

medium · MCQ · Q-DD7717

An application may retry sending an invoice message because of a transient network failure. The application sets the same MessageId for each retry, and duplicate detection is enabled on the Azure Service Bus queue with a detection window that includes all retries. How does Service Bus handle a retry whose MessageId matches a message already accepted within the detection window?

  1. A.It stores the retry as a separate message because the message bodies may differ.
  2. B.It rejects the entire queue because duplicate MessageId values are invalid.
  3. C.It accepts the retry but assigns it a new MessageId.
  4. D.It suppresses the duplicate and does not add another copy to the queue.Correct answer

Solution

Service Bus duplicate detection uses the MessageId value within the configured detection window. A message with a previously accepted MessageId is suppressed, helping make retried sends idempotent.

More from Azure Service Bus

All of Azure Service Bus

Practise more Connect to and Consume Azure and Third-party Services

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed