3

I'm using the Azure Service Bus REST API to send a batch of messages to a topic. My namespace is a "Standard" SKU, it means that I have a maximum message size of 256KB.

When using the batch send, it sounds like the limit is per batch (max is 256KB for the batch) and not per message. Nothing is really explained in the documentation, am I right?

And unfortunately, I receive a "Bad Request" error instead of a "Quota exceeded or message too large." error (status 403).

I want to know if I missed something here or if the batch size is also limited to 256KB? And why I didn't receive a 403 error in this case?

Thanks.

David GROSPELIER
  • 772
  • 1
  • 9
  • 35
  • I'm not able to find the documentation but the batch size is limited to 256KB. Also you should get 403 error when there's something wrong with authorizing. Since this is a user error, you will get a bad request error. https://stackoverflow.com/questions/31045100/sending-1000-brokered-messages-to-the-service-bus-using-the-sendbatchasync-metho – Gaurav Mantri Oct 27 '17 at 15:41
  • Hi, in the documentation the 403 error is described as "Quota exceeded or message too large" (doc is here https://learn.microsoft.com/en-us/rest/api/servicebus/send-message-to-queue). – David GROSPELIER Oct 27 '17 at 16:06
  • For information, the documentation is wrong, the API returned a 413 http code not a 403. – David GROSPELIER Nov 07 '17 at 08:10

1 Answers1

3

The batch is treated no different from a single message. It's a payload. Payload cannot exceed 256KB on Standard Tier (1MB on Premium). Batch dodo cannot contain more than a 100 messages.

You can find more info on the topic and how to handle it in my blog post.

Sean Feldman
  • 23,443
  • 7
  • 55
  • 80
  • Now that the Azure premium can take upto 100 MB of message, do you think the batch size can still be 100 MB? I tried my PoCs using the latest C# SDK and it still cannot push more than 1 MB per batch. However, I have set the per-message size to 20 MB and tries going upto 100 MB. Seems, the SDK documentation is not clear as to what are the limits. If you have the details, could you please kindly share? – Arun Prakash Nagendran Jan 03 '22 at 08:42
  • What batch API are you using? – Sean Feldman Jan 04 '22 at 04:55
  • Azure.Messaging.ServiceBus -> I tried SendMessagesAsync. Used overloads ServiceBusMessageBatch as well as the IEnumerable. – Arun Prakash Nagendran Jan 04 '22 at 06:19
  • Batching [doesn't support](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-premium-messaging#large-messages-support) large messages. – Sean Feldman Jan 07 '22 at 06:03