Azure 事件中心(事件处理器主机与直接接收器)

标签 azure azure-eventhub azure-eventhub-client

我正在使用事件中心,想知道哪一种是更好的消费事件方法 事件处理器主机或直接接收器。如果其中之一更好,那么为什么。

您还可以帮助我任何 java 代码示例 github 或 java Azure SDK 来编写事件使用者。

使用分区和消费者组是更好的方法吗?

最佳答案

Does using partitions and consumer groups is better approach

无论您如何消费事件,您始终拥有至少一个消费组和至少 2 个分区。它不是可选的。

Also Can you help me any java code sample github or java Azure SDK to write event consumer.

大量docs可获取started

I am using Event Hub, wanted to know which one is better approach to consume events Event Processor Host or Direct Receivers. if one of it is better then why.

根据the docs :

For most production scenarios, we recommend that you use the event processor client for reading and processing events. The processor client is intended to provide a robust experience for processing events across all partitions of an event hub in a performant and fault tolerant manner while providing a means to checkpoint its progress. Event processor clients can work cooperatively within the context of a consumer group for a given event hub. Clients will automatically manage distribution and balancing of work as instances become available or unavailable for the group.

关于直接消费者:

This method is not recommended for production use; the EventProcessorClient should be used for reading events from all partitions in a production scenario, as it offers a much more robust experience with higher throughput.

使用直接消费者时,您需要手动执行检查点。使用处理器主机可以解决这个问题。此外,使用处理器主机可以更好地处理负载分配

关于Azure 事件中心(事件处理器主机与直接接收器),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75604963/

相关文章:

azure - 是否可以在不使用实际事件中心的情况下在本地执行事件中心触发的 Azure Functions?

javascript - 导入EventHubManagementClientOptionalParams返回错误

azure - 处理 Azure 函数表绑定(bind)中的可选参数

azure - 为什么我在 Azure 应用程序网关中看到 403 禁止?

.net - Azure - 表存储建模

azure - 无法更新自动缩放配置。 (Azure 比例集)

azure - 如何将 Azure 服务总线与事件中心集成?

Azure 事件中心捕获已打开,但未收到文件