Chapter 4 · AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services
Azure Service Bus
20 practice questions · 5 marks weightage
Practice questions
- Question 1Q-4D0390See the answer and solution
An order-processing application must send the same order notification independently to an email service, an inventory service, and an analytics service. Each service must be able to receive every notification at its own pace. Which Azure Service Bus design should you use?
- A.Create one queue and have all services compete for its messages
- B.Create a topic with one subscription for each service
- C.Create one queue for each service and send the message to only one queue
- D.Create one subscription and use multiple competing receivers
- Question 2Q-18B85ASee the answer and solution
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 message
- 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
- Question 3Q-02D467See the answer and solution
A billing system sends multiple messages for each customer and sets the same SessionId for all messages belonging to that customer. The application must process each customer's messages in order, while processing different customers concurrently. The queue has sessions enabled. Which receiver should the application use?
- A.A standard ServiceBusProcessor with multiple message handlers and no session configuration
- B.A ServiceBusReceiver created with ReceiveMode set to ReceiveAndDelete
- C.A ServiceBusSessionProcessor, allowing separate sessions to be processed concurrently
- D.A single ServiceBusReceiver that reads messages from the queue and sorts them by customer after receiving them
- Question 4Q-6E18F0See the answer and solution
A worker receives a message from an Azure Service Bus queue in PeekLock mode, but the message contains invalid data and cannot be processed. The queue's MaxDeliveryCount is set to 5. What happens after the message exceeds the allowed delivery attempts?
- A.The message is automatically deleted permanently.
- B.The message is moved to the queue's dead-letter subqueue.
- C.The message is transferred to the next available queue.
- D.The message is returned to the queue with its delivery count reset.
- Question 5Q-DD7717See the answer and solution
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?
- A.It stores the retry as a separate message because the message bodies may differ.
- B.It rejects the entire queue because duplicate MessageId values are invalid.
- C.It accepts the retry but assigns it a new MessageId.
- D.It suppresses the duplicate and does not add another copy to the queue.
15 more questions on Azure Service Bus
Sign up free to practise the full chapter. Questions you get wrong come back until you've mastered them.
Start practising freeFree to start · No credit card needed