Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/306.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# (412)指定了租约ID,但blob的租约已过期_C#_Azure_Azureservicebus_Azure Eventhub - Fatal编程技术网

C# (412)指定了租约ID,但blob的租约已过期

C# (412)指定了租约ID,但blob的租约已过期,c#,azure,azureservicebus,azure-eventhub,C#,Azure,Azureservicebus,Azure Eventhub,我的事件处理器在设置检查点时有时会收到异常: System.AggregateException:发生一个或多个错误。-->>Microsoft.ServiceBus.Messaging.LeaseLosteException:引发了类型为>“Microsoft.ServiceBus.Messaging.LeaseLosteException”的异常。-->>Microsoft.WindowsAzure.Storage.StorageException:远程服务器返回>错误:(412)指定了租约

我的事件处理器在设置检查点时有时会收到异常:

System.AggregateException:发生一个或多个错误。-->>Microsoft.ServiceBus.Messaging.LeaseLosteException:引发了类型为>“Microsoft.ServiceBus.Messaging.LeaseLosteException”的异常。-->>Microsoft.WindowsAzure.Storage.StorageException:远程服务器返回>错误:(412)指定了租约ID,但blob的租约已过期..->-->System.Net.WebException:远程服务器返回错误:(412)指定了租约>ID,但blob的租约已过期

我是否可以在ProcessEventsAsync方法中选中点之前续订租约? 或者,我如何管理分区ManagerOptions以使其正常工作

代码:

公共虚拟任务进程事件同步(分区上下文,IEnumerable消息) { //一些加工 context.CheckpointAsync().Wait(); 返回Task.FromResult(0); }
感谢您的帮助

如果
EPH
(EventProcessorHost)无论何时,
EPH
loadbalances
EventHubs
跨“
EPH
实例的分区都会发生这种情况,并且如果您偶尔看到它(也称为不太频繁),这种情况是无害的。
有关租约管理的详细说明,请参阅。

我不确定StackTrace是否指示调用CheckpointAsync时发生异常。或者你是说你在调试器中看到了这种行为?
public virtual Task ProcessEventsAsync(PartitionContext context, IEnumerable<EventData> messages)
{
    //some processing
    context.CheckpointAsync().Wait();
    return Task.FromResult(0);
}