azure - 无法正确理解事件中心消费者组的工作方式

标签 azure azure-eventhub

要求我想并行处理来自多个消费者的事件数据(相同数据)

enter image description here

我从文档中了解到,要处理来自事件中心的相同数据,我们需要创建多个消费者组。

消费者组使多个消费应用程序能够各自拥有事件流的单独 View ,并以自己的速度和自己的偏移量独立读取流。

消息保留1, 分区数3

enter image description here

问题:我没有从 log1 消费者组获取数据,而是从 log1 获取数据。当我尝试 $Default 和 log2 消费者组时,我正在并行获取数据。

谁能帮我解决这个问题?

最佳答案

基于official doc ,你的理解是正确的。我尝试创建与您相同的事件中心来重现您的问题。

enter image description here

enter image description here

我通过java代码启动2个EPH来分别监控Log1和log2。

然后,我向事件中心发送 10 条消息来观察 2 EPH 控制台日志。

enter image description here

好像都能收到他们两个的消息,不过顺序乱了。我猜你的问题是延迟

<小时/>

更新答案:

据我所知,Azure 事件中心的延迟可能会受到许多方面的影响。也许是网络,内部机制。但是,Azure 事件中心可确保您的数据在有效存储时间内不会丢失。

如果需要保证数据的实时性,可以使用Kafka用于构建实时数据管道和流应用程序。

关于azure - 无法正确理解事件中心消费者组的工作方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50097386/

相关文章:

powershell - Azure PowerShell 设置-AzureService/获取-AzureService -错误 : the hosted service does not exist

azure - 子代码=40000。数据湖文件夹路径

java - azure eventHub 绑定(bind)(Java)是否支持@EventHubOutput 的partitionKey?

hadoop - 我应该如何将我的事件流保存到冷存储?

azure - 更改 Azure Devops 发布管道中 yaml 文件的分支

azure - Autorest 无法生成任何内容,并且没有错误

.net - 删除 Azure 上的特定 Application Insights 事件

azure - 了解耐用功能的实际好处

Azure Functions 事件中心触发器绑定(bind)

azure - 事件中心接收缓慢