【问题标题】:Dapr input binding with Azure Event Hub processes messages synchronouslyDapr 输入绑定与 Azure 事件中心同步处理消息
【发布时间】:2021-03-12 10:18:42
【问题描述】:

我们使用 dapr 和输入绑定来使用来自 Azure 事件中心的 IoT 事件。 事件中心有 32 个分区,发送方使用设备 ID 作为分区键。 接收事件的控制器将它们委托给 dapr Actors 进行处理。

现在我的期望是,每个分区中的消息是并行处理的,从而导致对接收事件的控制器的并行请求允许处理多达 32 个并发事件批次。

但是测试表明事件是同步接收的。在前一个事件的完整处理完成后立即收到后续事件。

现在我知道参与者按照设计一个接一个地处理消息,但根据the documentation,我没有读过类似的输入绑定。

有什么我完全想念的吗?否则我无法想象这个系统如何扩展。

我们正在使用 dapr 0.11 以及在 AKS 集群中运行的 ASP.NET Core 3.1。

【问题讨论】:

    标签: docker asp.net-core azure-aks azure-eventhub dapr


    【解决方案1】:

    我刚刚在 GitHub 上得到了答案:https://github.com/dapr/components-contrib/issues/759

    所以这基本上证实了我基于当前版本的 dapr 事件中心绑定的观察。

    但是,您可以手动配置每个 dapr 组件的分区 ID。因此,要同时读取 32 个分区,您目前必须使用 32 个 dapr 组件,每个组件都从一个单独的分区读取。

    引用上面的 GitHub 问题:

    [...] you can specify a Dapr component per partition ID: https://docs.dapr.io/operations/components/setup-bindings/supported-bindings/eventhubs/
    
    If you set the partitionID field on the component metadata, the consumer will pull all messages for that partition ID.
    Otherwise, it'll pull from all partitions.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-04-16
      • 1970-01-01
      • 2018-06-02
      • 1970-01-01
      • 1970-01-01
      • 2016-02-22
      • 1970-01-01
      相关资源
      最近更新 更多