2016-11-30 78 views
2

我想推送一条消息到azure服务总线,比方说大小为3 MB。 为此,我写道:如何推送azure服务总线中的最大长度消息

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); 

我收到以下异常。

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> 

我不是不知道这是什么意思,我该如何解决问题。请帮我解决这个问题。

回答

3

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

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

相关问题