2

If we can store messages by specifying partition key, then how we can retrieve all messages from a particular partition by specifying the partition key?

1 Answers1

0

As per the documentation in partition enabled Service bus a receiving client isn't aware of the partitioning and its client-facing behavior is similar to normal queues and topics. Now if you also have session ID property set then you can follow this documentation to receive messages based on their session ID's.

ChaitanyaN-MSFT
  • 466
  • 2
  • 5
  • How we can make sure the order of messages within the service bus queue? – Imran Ahmad Mughal Sep 22 '21 at 08:06
  • FIFO guarantee in Service Bus is maintained by using sessions -> https://learn.microsoft.com/en-us/azure/service-bus-messaging/message-sessions#first-in-first-out-fifo-pattern – ChaitanyaN-MSFT Sep 22 '21 at 17:11
  • If you have just set-up a Session ID in partitioned queue it is used as partition key also. If partitioned queue has both partition key and session ID set-up then they both should have the same value. So all messages that belong to the same session are handled by the same message broker. Sessions enable Service Bus to guarantee message ordering as well as the consistency of session states. – ChaitanyaN-MSFT Sep 22 '21 at 17:17