You are designing an order-processing workflow on Azure Service Bus. All messages for the same OrderID must be processed in strict FIFO order, and you need to maintain per-order state across messages to track the workflow stage. What should you do?
Choose an answer
Tap an option to check your answer.
Correct answer: Enable RequiresSession on the target queue or subscription., Set the SessionId to the OrderID for all messages in an order., Receive messages with a SessionReceiver and use GetState/SetState to persist the per-order workflow state..
Why this is the answer
To ensure strict FIFO ordering for messages belonging to the same OrderID and maintain per-order state, Azure Service Bus sessions are the correct approach. Enabling RequiresSession on the queue or subscription is fundamental, as it instructs Service Bus to only deliver messages that belong to a session and allows session-aware receivers to connect. Setting the SessionId of all messages for a given order to the OrderID groups these messages into a single session. This ensures that all messages with the same SessionId are processed sequentially by a single receiver. Finally, using a SessionReceiver allows you to interact with the session state using GetState and SetState, which is crucial for persisting the per-order workflow stage directly within the Service Bus session, ensuring state is maintained across messages for that specific order. Setting MessageId to OrderID does not guarantee FIFO processing or state management. Message deferral is for reordering messages within a single session, not for establishing sessions or managing state across them.
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