2016-11-30 79 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。

相關問題