什么是 Azure Eventhub Python SDK v5.x.x 等同于 EPHOptions.keep_alive_interval 的 v1.x.x

What is Azure Eventhub Python SDK v5.x.x equivalent of EPHOptions.keep_alive_interval which was a part of v1.x.x

我一直在将 Python Eventhub SDK 从 v1 迁移到 v5。 由于 EPHOptions 在新版本中已弃用。我将无法在 v5.x.x

中使用它

我想使用 EPHOptions.keep_alive_interval,它在 Python Eventhub SDK v5.x.x 中的等效项是什么?

目前 V5.x.x SDK 中没有等效的 class。

In V1, EventProcessorHost allowed you to balance the load between multiple instances of your program when receiving events.

In V5, EventHubConsumerClient allows you to do the same with the receive() method if you pass a CheckpointStore to the constructor.

在V5中,您需要使用EventHubConsumerClient来接收事件。但是没有设置参数keep_alive_interval.

参考:

https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/eventhub/azure-eventhub/migration_guide.md#migrating-code-from-eventprocessorhost-to-eventhubconsumerclient-for-receiving-events

https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/eventhub/azure-eventhub/azure/eventhub/_consumer_client.py