@Ashish Sabne Thanks for reaching out. As you are getting the MessageSizeExceededException so it looks like your production namespace is under the standard tier as 256 KB is the max message size supported in standard service bus.
However, that limit does not seem to be enforced on my local machine as well as DEV, QA or UAT environments (all of which are on Azure) but only on PRODUCTION server. Why is that limit enforced selectively?
When you mentioned that you don't observe the same behavior in the DEV, QA or UAT environments so I will suggest you to first verify which SKU is your namespace in different environment. In case if the SKU is same i.e. standard for all the environment then have you tested the same message content and size sending to different environment as it will behave the same and you should get the MessageSizeExceededException exception for the same message size/content and for the same standard SKU.
Is there an alternative without having to breakup the original message, since that is not an option due to certain business scenarios
You can either migrate your production namespace to premium namespace by migrating to premium option under your namespace and for more details please refer to this document.
Alternative you can either break your original message or the pricing tier or use the claim check pattern described in this blog post if you're dealing with messages of size greater than the allowed size.
Feel free to get back to me if you have any queries or concerns.
Please accept as "Yes" if the answer is helpful so that it can help others in the community. If you need any help/clarification/concerns/follow up questions, then please click on "Add Comment" on my answer and provide more details.
Hi @Ashish Sabne
I hope the answer helps. Feel free to get back to me if you need any assistance.
Please accept as "Yes" if the answer is helpful so that it can help others in the community. If you need any help/clarification/concerns/follow up questions, then please click on "Add Comment" on my answer and provide more details.