A worker processes messages from a Service Bus queue (QueueA). For each message, it must send a notification to a topic (TopicB) and a command to another queue (QueueC), then complete the original message. All three operations must succeed or fail together. What should you do?
Choose an answer
Tap an option to check your answer.
Correct answer: Perform the receive-complete on QueueA and the sends to TopicB and QueueC inside a Service Bus transaction (TransactionScope or ServiceBusTransaction) using the same ServiceBusClient connection., Ensure QueueA, TopicB, and QueueC are in the same Service Bus namespace..
Why this is the answer
The correct options address the requirement for atomicity across multiple Service Bus operations. Performing the receive-complete on QueueA and the sends to TopicB and QueueC inside a Service Bus transaction (TransactionScope or ServiceBusTransaction) using the same ServiceBusClient connection ensures that all these operations are treated as a single atomic unit. If any operation within the transaction fails, all operations are rolled back, guaranteeing an "all or nothing" outcome. This is a core feature of Service Bus transactions. Ensuring QueueA, TopicB, and QueueC are in the same Service Bus namespace is a prerequisite for Service Bus transactions to function. Transactions in Azure Service Bus are scoped to a single namespace. Using separate ServiceBusClient instances would prevent transactional behavior, as each instance would operate independently. Enabling duplicate detection on entities does not guarantee atomicity across multiple distinct operations; it only prevents processing the same message twice. Azure Functions with multiple output bindings do not inherently guarantee atomic commits across different Service Bus entities in the way a Service Bus transaction does; the function runtime ensures the function execution, but not the transactional integrity of external services.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed