Courseiva

AZ-204 Practice Question: Connect to and consume Azure services and third-party services

You are designing a solution that requires asynchronous processing of messages from an Azure Service Bus queue. The solution must guarantee at-least-once delivery and handle poison messages automatically. Which combination of Service Bus features should you use?

⚠ Common exam trap

Many exam-takers confuse sessions with poison message handling, but sessions are for message ordering and grouping, not for automatically moving failed messages to a dead-letter queue.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

PeekLock mode with dead-letter queue

PeekLock mode is required for at-least-once delivery because it allows the consumer to process the message and then explicitly complete it, ensuring the message is not removed from the queue until processing succeeds. The dead-letter queue automatically handles poison messages by moving messages that exceed the maximum delivery count or fail processing, preventing them from blocking the queue.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ReceiveAndDelete mode with a separate dead-letter queue

    Why it's wrong here

    In ReceiveAndDelete mode, messages are removed from the queue immediately upon retrieval by the consumer. If the consumer fails to process the message after it has been deleted, the message is irrevocably lost and cannot be recovered or reprocessed. A separate dead-letter queue would be ineffective here, as the message is already gone from the main queue before any processing failure could trigger its transfer to a DLQ. This mode does not support at-least-once delivery guarantees.

  • ReceiveAndDelete mode with automatic forwarding

    Why it's wrong here

    ReceiveAndDelete mode inherently lacks reliability because messages are deleted from the queue as soon as they are consumed, without confirmation of successful processing. If a processing error occurs post-deletion, the message is lost. Automatic forwarding, while a useful feature for routing messages from one entity to another, does not address the fundamental problem of message loss or poison message handling within the ReceiveAndDelete paradigm. It merely moves messages, not ensures their reliable processing or recovery.

  • PeekLock mode with sessions

    Why it's wrong here

    While PeekLock mode is essential for reliable message processing by allowing a consumer to temporarily lock a message for processing, sessions serve a distinct purpose. Sessions are designed to ensure ordered processing of related messages by grouping them and guaranteeing that all messages within a session are processed by a single consumer in sequence. They do not inherently provide a mechanism for handling individual poison messages that repeatedly fail processing; that is managed by the message's delivery count and the dead-lettering policy.

  • PeekLock mode with dead-letter queue

    Why this is correct

    PeekLock mode is the correct choice for reliable asynchronous processing because it ensures at-least-once delivery. When a message is received in PeekLock mode, it is locked for a configurable duration, making it invisible to other consumers. If processing fails, the lock expires or the message is explicitly abandoned, making it available for redelivery. After a message exceeds the MaxDeliveryCount due to repeated failures, Azure Service Bus automatically moves it to the associated dead-letter queue, allowing for later inspection and manual reprocessing of poison messages.

About these practice questions

Courseiva writes every AZ-204 question from scratch — 881 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.