如何更新接收队列消息处理程序上的锁? 在事件处理程序上,测试消息没有更新锁定属性。
Message testMessage;
最佳答案
目前,建议使用 Azure.Messaging.ServiceBus NuGet 包,因为 Microsoft.Azure.ServiceBus 已过时。以下是自动续订处理消息的示例代码:
var client = new ServiceBusClient(connectionString);
var processor = client.CreateProcessor(queueName, new ServiceBusProcessorOptions
{
MaxAutoLockRenewalDuration = TimeSpan.FromHours(100),
});
processor.ProcessMessageAsync += async arg =>
{
//process your message
await Task.Delay(Timeout.Infinite);
};
processor.ProcessErrorAsync += async arg =>
{
//process errors
};
关于.net - Azure服务总线: How to Renew Lock?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63585687/