Azure Service Bus · AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services
A .NET application uses an Azure.Messaging.ServiceBus ServiceBusProcessor with AutoCompleteMessages set to false and the default PeekLock receive mod…
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-18B85A
A .NET application uses an Azure.Messaging.ServiceBus ServiceBusProcessor with AutoCompleteMessages set to false and the default PeekLock receive mode. The handler successfully processes a message. Which action should the handler perform so that the message is removed from the queue?
- A.Call CompleteMessageAsync on the ServiceBusReceiver with the received messageCorrect answer
- B.Call AbandonMessageAsync on the ServiceBusReceiver with the received message
- C.Call DeferMessageAsync on the ServiceBusReceiver with the received message
- D.Call RenewMessageLockAsync on the ServiceBusReceiver with the received message
Solution
In PeekLock mode, the message remains in the queue until it is settled. With automatic completion disabled, the handler must call CompleteMessageAsync after successful processing. Abandoning makes it available for redelivery, deferring postpones retrieval, and renewing only extends the lock.
More from Azure Service Bus
- An order-processing application must send the same order notification independently to an email service, an inventory service, and an analy…
- A billing system sends multiple messages for each customer and sets the same SessionId for all messages belonging to that customer. The app…
- A worker receives a message from an Azure Service Bus queue in PeekLock mode, but the message contains invalid data and cannot be processed…
- An application may retry sending an invoice message because of a transient network failure. The application sets the same MessageId for eac…
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 freeFree to start · No credit card needed