我一直在实现一个响应OnMessageAsync的侦听器。这完全符合预期,但在调试源中它会不断触发这些异常:
Exception thrown: 'System.ServiceModel.FaultException`1' in Microsoft.ServiceBus.dll
Exception thrown: 'System.ServiceModel.FaultException`1' in Microsoft.ServiceBus.dll
Exception thrown: 'System.ServiceModel.FaultException`1' in Microsoft.ServiceBus.dll
Exception thrown: 'System.ServiceModel.FaultException`1' in Microsoft.ServiceBus.dll
Exception thrown: 'System.ServiceModel.FaultException`1' in Microsoft.ServiceBus.dll
Exception thrown: 'System.TimeoutException' in Microsoft.ServiceBus.dll
这组6个异常似乎每分钟触发一次。有谁知道为什么这些触发器或究竟是什么导致这些异常?
代码段:
OnMessageOptions options = new OnMessageOptions
{
MaxConcurrentCalls = 5,
AutoComplete = false
};
QueueClient client = QueueClient.CreateFromConnectionString(inboundConnectionString, ReceiveMode.PeekLock);
client.OnMessageAsync(async m =>
{
try
{
await ProcessMessageAsync(m);
...
}
...
}, options);
AutoRenewTimeout似乎没有对OnMessageOptions产生影响。