Azure - 并发呼叫 - 服务总线

时间:2014-05-28 13:09:27

标签: c# azure servicebus

我正在尝试调试Azure Service Bus。

我做什么:

            long countOpen = namespaceManager.GetQueue(queueStrOpen).MessageCount;
            long countClose = namespaceManager.GetQueue(queueStrClose).MessageCount;
            QClientOpen = QueueClient.CreateFromConnectionString(connectionString, queueStrOpen, ReceiveMode.ReceiveAndDelete);
            QClientClose = QueueClient.CreateFromConnectionString(connectionString, queueStrClose, ReceiveMode.ReceiveAndDelete);


                if (countOpen > 0)
                {
                    QClientOpen.OnMessage(OnMessageOpen,eventDrivenMessagingOptions);
                }
                if (countClose > 0)
                {
                    QClientClose.OnMessage(OnMessageClose,eventDrivenMessagingOptions);
                }

我的错误是什么:

Exception: Microsoft.ServiceBus.Messaging.ServerBusyException: Maximum number of
 concurrent receive requests is exceeded on entity '*****:QUEUE:ORDERSPRAC'.
 The limit is '5000'. Error code : 50004.TrackingId:63eefddf-0503-4c30-a2de-55fe
 450ac83c_G4_B21,TimeStamp:5/28/2014 12:57:30 PM.f71029ea-23c6-4ad0-8360-8b27818c
 9046_G4 ---> System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Maximum number of concurrent receive requests is exceeded on entity '*****:QUEUE:ORDERSPRAC'. The limit is '5000'. Error code : 50004.TrackingId:63e efddf-0503-4c30-a2de 55fe450ac83c_G4_B21,TimeStamp:5/28/2014 12:57:30 PM.f71029ea-23c6-4ad0-8360-8b27818c9046_G4

 Server stack trace:
 at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequest SessionChannel.ThrowIfFaultMessage(Message wcfMessage)
 at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequest SessionChannel.HandleMessageReceived(IAsyncResult result)

此错误不会每次都弹出。它有时只是一个错误是捕获(上面的那个)。 如何以及为什么会出现此消息而我检查如果我的消息计数大于0。

它不应该进行一次精确的接听电话,但确实如此,并且经过一天和很多IF条件,很多谷歌搜索我都没想到。

1 个答案:

答案 0 :(得分:0)

你能否分享你为" MaxConcurrentCalls"设定的价值? OnMessageOptions中的属性(上面示例中的eventDrivenMessagingOptions)。此选项确定对服务进行的并发接收呼叫的数量。