Topic: Microsoft AZ-305 topic 4 question 79

You are designing an app that will include two components. The components will communicate by sending messages via a queue.

You need to recommend a solution to process the messages by using a First in, First out (FIFO) pattern.

What should you include in the recommendation?

A.
storage queues with a custom metadata setting
B.
Azure Service Bus queues with partitioning enabled
C.
Azure Service Bus queues with sessions enabled
D.
storage queues with a stored access policy

Re: Microsoft AZ-305 topic 4 question 79

C is the answer.

https://learn.microsoft.com/en-us/azure/service-bus-messaging/message-sessions
Azure Service Bus sessions enable joint and ordered handling of unbounded sequences of related messages. Sessions can be used in first in, first out (FIFO) and request-response patterns. This article shows how to use sessions to implement these patterns when using Service Bus.

Re: Microsoft AZ-305 topic 4 question 79

C. Azure Service Bus queues with sessions enabled

Explanation:

Azure Service Bus supports a FIFO pattern through the use of sessions. A session is a sequence of ordered messages. All messages in a session are handled in the order they arrive. This ensures that messages are processed in the order they were added to the queue.

Options A and D are incorrect because Azure Storage queues do not natively support the First In, First Out (FIFO) pattern. There are no such features as custom metadata setting or stored access policy that can establish FIFO in Azure Storage queues.

Option B is incorrect because while partitioning in Azure Service Bus can improve performance by spreading the load across multiple message brokers and stores, it doesn't enforce FIFO ordering across partitions. FIFO ordering is maintained within a partition, but not across partitions. Hence, for strict FIFO, you would not want to enable partitioning, you would want to use sessions.

Re: Microsoft AZ-305 topic 4 question 79

Given Answer C is correct
Service Bus queues are part of a broader Azure messaging infrastructure that supports queuing, publish/subscribe, and more advanced integration patterns. They're designed to integrate applications or application components that might span multiple communication protocols, data contracts, trust domains, or network environments
Advanced messaging features like first-in and first-out (FIFO), batching/sessions, transactions, dead-lettering, temporal control, routing and filtering, and duplicate detection

Re: Microsoft AZ-305 topic 4 question 79

The wording of the question is slightly misleading.
A queue has by default a FIFO mechanism to send and receive messages.
In this context the user wants to create his own CUSTOM order.
To do this, sessions are used to mark the messages that should be received first, then second, etc, so what is known as FIFO is broken.

This article helps with a visualization of the process:

https://learn.microsoft.com/en-us/azure/service-bus-messaging/message-sessions#session-features

A session is like a subqueue.

Re: Microsoft AZ-305 topic 4 question 79

"Azure Service Bus queues with sessions enabled"

As a solution architect/developer, you should consider using Service Bus queues when your solution requires the queue to provide a guaranteed first-in-first-out (FIFO) ordered delivery.
https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-azure-and-service-bus-queues-compared-contrasted#consider-using-service-bus-queues

Sessions can be used in first in, first out (FIFO) and request-response patterns.
https://learn.microsoft.com/en-us/azure/service-bus-messaging/message-sessions

Re: Microsoft AZ-305 topic 4 question 79

C. Azure Service Bus queues with sessions enabled.

Azure Service Bus queues with sessions enabled ensure a FIFO pattern by allowing messages to be processed in order, and messages are processed by a single receiver instance.

Re: Microsoft AZ-305 topic 4 question 79

C. Azure Service Bus queues with sessions enabled

Re: Microsoft AZ-305 topic 4 question 79

C is a go and recommended from what i can see.


Service Bus queues ordering guarantee
Yes - First-In-First-Out (FIFO)
(by using message sessions)

Re: Microsoft AZ-305 topic 4 question 79

Only Service Bus quarantees FIFO and you need to use Sessions for this.

https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-azure-and-service-bus-queues-compared-contrasted

Re: Microsoft AZ-305 topic 4 question 79

C:
Sessions: Enabling sessions on an Azure Service Bus queue allows for grouping of related messages together. This can be useful if you need to ensure that messages related to a specific session or conversation are processed in order. With sessions, you can also allow multiple consumers to process messages from the same session in parallel, which can improve the overall throughput of the queue. This is useful if you expect to have a large number of conversations and need to scale out the processing of those messages.