如何在 azure 服务总线中推送最大长度消息

Ana*_*ukh 2 jms servicebus azure azureservicebus

我想将消息推送到 azure 服务总线,比如大小为 3 MB。为此,我写道:

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);
Run Code Online (Sandbox Code Playgroud)

我收到以下异常。

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> 
Run Code Online (Sandbox Code Playgroud)

我不明白这是什么意思,我应该如何解决这个问题。请帮我解决这个问题。?

Sea*_*man 5

maxSizeInMegabytes指队列中消息的最大总大小,而不是单个消息大小。标准层的单个消息大小不能超过 256KB,高级层的单个消息大小不能超过 1MB(包括两者的标头)。

如果您希望发送大于 Maxim 消息大小的消息,则必须实现声明检查模式(http://www.enterpriseintegrationpatterns.com/patterns/messaging/StoreInLibrary.html)或使用执行此操作的框架为你。自己实现意味着将有效负载存储为存储 blob 并且消息将包含 Uri。