Anand Deshmukh
Anand Deshmukh

Reputation: 113

How to push the Maximum length message in azure service bus

I want to push a message into azure service bus, let say of size 3 MB. for this, I have wrote :

QueueInfo queueInfo = new QueueInfo("sq-jcibe-microservice-plm-qa");
long maxSizeInMegabytes = 5120;
queueInfo.setMaxSizeInMegabytes(maxSizeInMegabytes); 
service.updateQueue(queueInfo);
service.sendQueueMessage("sq-jcibe-microservice-plm-qa", brokeredMessage);

I am getting following exception.

com.microsoft.windowsazure.exception.ServiceException: com.sun.jersey.api.client.UniformInterfaceException: PUT https://sb-jcibe-microservice-qa.servicebus.windows.net/sq-jcibe-microservice-plm-qa?api-version=2013-07 returned a response status of 400 Bad Request
Response Body: <Error><Code>400</Code><Detail>SubCode=40000. For a Partitioned Queue, ordering is supported only if RequiresSession is set to true.&#xD;
Parameter name: SupportOrdering. TrackingId:59bb3ae1-95f9-45e1-8896-d0f6a9ac2be8_G3, SystemTracker:sb-jcibe-microservice-qa.servicebus.windows.net:sq-jcibe-microservice-plm-qa, Timestamp:11/30/2016 4:52:22 PM</Detail></Error> 

I am not undrstanding what does it mean and how should I resolve the problem.Please help me out with this scenario.?

Upvotes: 2

Views: 1747

Answers (1)

Sean Feldman
Sean Feldman

Reputation: 26057

maxSizeInMegabytes refers to the maximum total size of the messages on a queue, not individual message size. Individual message size cannot exceed 256KB for a standard tier, and 1MB for a premium tier (including headers for both).

If you wish to send messages larger than the Maxim message size, you'll have to either implement a claim check pattern (http://www.enterpriseintegrationpatterns.com/patterns/messaging/StoreInLibrary.html) or use a framework that does it for you. Implementing yourself would mean something among the lines of storing the payload as a Storage blob and message would contain the Uri.

Upvotes: 5

Related Questions