Azure Service Bus · AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services

A billing system sends multiple messages for each customer and sets the same SessionId for all messages belonging to that customer. The application m…

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.

hard · MCQ · Q-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 concurrentlyCorrect answer
  4. D.A single ServiceBusReceiver that reads messages from the queue and sorts them by customer after receiving them

Solution

A ServiceBusSessionProcessor is designed for session-aware entities. Service Bus provides an exclusive session lock and preserves message order within a session, while different sessions can be handled concurrently. Receive mode does not provide ordering, and sorting after receipt cannot reliably restore the required processing semantics.

More from Azure Service Bus

All of Azure Service Bus

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 free

Free to start · No credit card needed