0

I am fetching messages from the Azure Bus Subscription in Batch. For the testing, I passed the BatchZise value 2000, but I got near about 300 messages on the list. Is there any specific rule like we can fetch the max size of messages or same time we will get only a particular number of records etc.?

What batch size would be the best due to performance.

enter image description here

Dilip Kr Singh
  • 1,418
  • 1
  • 18
  • 26

2 Answers2

1

You can find the docs on link https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-azure-and-service-bus-queues-compared-contrasted

Microsoft already mentioned batch size for service bus will not go above 256 KB.

Screenshot: enter image description here

Shrirang
  • 1,286
  • 10
  • 23
  • Maximum message size is not related to this. You could have less than 1KB message size and still have this problem. – Sean Feldman Jul 23 '21 at 04:43
  • What I am trying to say is 354 message batch are of size most 256 KB. So even if we pass 2000 batch size, it can not send that much message in a batch due to message size limitation. – Shrirang Jul 23 '21 at 04:59
  • That's incorrect. If you're using the Premium tier, max message time could be up to 100MB. And this has nothing to do with the message size but with how the broker works. Reduce from 2000 messages to 200 and you'll still see this behaviou. – Sean Feldman Jul 23 '21 at 05:14
0

The parameter you're passing into the request is the maximum number of messages to fetch. Not an exact number of messages to fetch. The broker will hand out as many messages as it can at that instance. If you need at least a certain number of messages (which I'm not sure why you'd want that) to receive be received, you'll have to loop through until you get that number or slightly more.

Sean Feldman
  • 23,443
  • 7
  • 55
  • 80