12

I've been looking into Azure Service Bus Queues (NOT Azure Storage Queues). All of the details that I have read indicate that it supports FIFO semantics, but only in the context of a "Messaging Session". The problem is that I can't seem to find any information on what exactly this is in the context of Azure. Is this a WCF construct, or something that is particular to Azure Service Bus? I assume that it does not relate to local transactions, but I am not 100% sure.

Any pointers would be very helpful. Thanks!

Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249
Erick T
  • 7,009
  • 9
  • 50
  • 85

2 Answers2

10

Specifically it refers to MessageSession, and it's the AcceptMessageSession method that holds the key by returning messages only for a given session id, which could be a sequence implying some ordering. The Brokered Messaging: Session Messages sample should help clarify, and the Best Practices document is another great reference.

Dene
  • 578
  • 5
  • 9
Jim O'Neil
  • 23,344
  • 7
  • 42
  • 67
  • Jim - Thanks for the answer. If I understand, the session id can be used to order messages, but there is nothing in the framework to provide those session ids. Meaning that you have to generate the sequence numbers to use for the session ids for FIFO. Is this correct? – Erick T Aug 29 '12 at 05:37
  • yes, that's my read as well... I was hoping to find a specific example of FIFO usage, but the sample I mentioned was the closest. – Jim O'Neil Aug 29 '12 at 13:53
  • Thanks Jim. If I put one together that is worth posting, I will add it here. – Erick T Aug 30 '12 at 17:14
  • Interesting question and answer i am asking the same thing... did you find or create an example for FIFO? – morleyc May 18 '13 at 05:32
1

Taken from MSDN:

SessionId: If a message has the Microsoft.ServiceBus.Messaging.BrokeredMessage.SessionId property set, then Service Bus uses the SessionId property as the partition key. This way, all messages that belong to the same session are handled by the same message broker. This enables Service Bus to guarantee message ordering as well as the consistency of session states.

For a coding sample employing SessionId and AcceptSessionReceiver see.

participant
  • 2,923
  • 2
  • 23
  • 40