AZ-204 Practice Question: Connect to and consume Azure services and third-party services
Which TWO are best practices when using Azure Service Bus for high-throughput messaging?
⚠ Common exam trap
Test-takers frequently confuse 'sessions' (which guarantee ordering but reduce throughput) with 'batching' (which improves throughput without ordering guarantees), or they mistakenly think duplicate detection is a harmless default rather than a performance-impacting feature.
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
✓
Enable batching of messages when sending
Enabling batching allows the client to accumulate multiple messages into a single AMQP or SBMP frame, reducing the number of network round trips and improving throughput. This is particularly effective in high-throughput scenarios where the overhead of individual sends becomes a bottleneck.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Enable duplicate detection for all queues
Why it's wrong here
Enabling duplicate detection for all queues is not a best practice because it introduces significant processing overhead and latency. This feature requires Service Bus to maintain a message ID history, consuming additional resources and potentially impacting throughput. While crucial for idempotent message processing in specific scenarios where "at-least-once" delivery might lead to application-level side effects, it should only be enabled selectively for queues where strict "exactly-once" processing semantics are absolutely required, not as a default.
- ✗
Use sessions to guarantee ordering
Why it's wrong here
Using sessions solely to guarantee ordering for all messages is not a best practice due to the inherent serialization it imposes. When messages are part of a session, they must be processed sequentially by a single receiver, which significantly reduces the potential for parallel processing and thus limits overall throughput. While sessions are essential for scenarios requiring ordered processing of related messages (e.g., stateful message sequences), their use should be carefully considered and restricted to specific business flows where message order within a logical group is paramount, rather than a general approach for all messages.
- ✓
Enable batching of messages when sending
Why this is correct
Enabling batching of messages when sending is a crucial best practice for optimizing Azure Service Bus performance. By grouping multiple messages into a single network operation, batching significantly reduces the number of round trips between the client application and the Service Bus namespace. This reduction in network overhead minimizes latency, improves overall message throughput, and can also lead to cost savings by consolidating billing operations, making it highly efficient for high-volume message ingestion.
- ✓
Use partitioned queues or topics
Why this is correct
Using partitioned queues or topics is a recommended best practice for achieving higher scalability and throughput in Azure Service Bus. Partitioning distributes the message store across multiple message brokers, allowing for concurrent processing of messages from different partitions. This parallelization significantly increases the overall capacity and throughput of the Service Bus entity, enabling it to handle a much larger volume of messages and consumer requests simultaneously compared to non-partitioned entities.
- ✗
Send messages larger than 256 KB to reduce the number of messages
Why it's wrong here
Sending messages larger than 256 KB is generally not a best practice, even if it appears to reduce the *number* of messages. Large messages consume more network bandwidth, increase serialization/deserialization times, and require more memory on both the sender and receiver, leading to higher latency and reduced overall system throughput. Furthermore, Service Bus has a maximum message size limit (typically 256 KB for Standard tier, 1 MB for Premium), and exceeding this requires using claims-based routing or external storage, adding complexity and cost.
Go deeper
Related to this question
Learn chapter
Azure Functions Development
Key term
Azure Relay
Azure Relay is a cloud service that securely exposes on-premises web services to the public internet or other cloud applications without opening firewall ports.
Key term
Azure Service Bus
Azure Service Bus is a cloud-based message broker that allows applications, services, and devices to send and receive messages reliably, even when they are not all running at the same time.
About these practice questions
This AZ-204 question is part of Courseiva's 881-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
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.