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

  1. Question 1Q-4D0390

    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?

    1. A.Create one queue and have all services compete for its messages
    2. B.Create a topic with one subscription for each service
    3. C.Create one queue for each service and send the message to only one queue
    4. D.Create one subscription and use multiple competing receivers
    See the answer and solution
  2. Question 2Q-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?

    1. A.Call CompleteMessageAsync on the ServiceBusReceiver with the received message
    2. B.Call AbandonMessageAsync on the ServiceBusReceiver with the received message
    3. C.Call DeferMessageAsync on the ServiceBusReceiver with the received message
    4. D.Call RenewMessageLockAsync on the ServiceBusReceiver with the received message
    See the answer and solution
  3. Question 3Q-02D467

    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?

    1. A.A standard ServiceBusProcessor with multiple message handlers and no session configuration
    2. B.A ServiceBusReceiver created with ReceiveMode set to ReceiveAndDelete
    3. C.A ServiceBusSessionProcessor, allowing separate sessions to be processed concurrently
    4. D.A single ServiceBusReceiver that reads messages from the queue and sorts them by customer after receiving them
    See the answer and solution
  4. Question 4Q-6E18F0

    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?

    1. A.The message is automatically deleted permanently.
    2. B.The message is moved to the queue's dead-letter subqueue.
    3. C.The message is transferred to the next available queue.
    4. D.The message is returned to the queue with its delivery count reset.
    See the answer and solution
  5. Question 5Q-DD7717

    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?

    1. A.It stores the retry as a separate message because the message bodies may differ.
    2. B.It rejects the entire queue because duplicate MessageId values are invalid.
    3. C.It accepts the retry but assigns it a new MessageId.
    4. D.It suppresses the duplicate and does not add another copy to the queue.
    See the answer and solution

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 free

Free to start · No credit card needed