azure - 具有多个输出到同一 EventHub 的 Azure 函数不起作用
问题描述
我有两个输出绑定到 Azure EventHub 的 Azure Function。输出到相同的 EH 但不同的主题。只要输出消息转到一个主题,它就可以正常工作。如果同时涉及两个主题,我会收到如下错误:
Exception while executing function: Functions.EventHubTriggerCSharp1.
Microsoft.Azure.WebJobs.Host: Error while handling parameter
outputEventHubMessageColdPath after function returned:. Microsoft.ServiceBus:
This event data instance has already been disposed.
尽管消息仅发送到 1 个主题。你知道为什么我不能得到关于这两个主题的消息吗?顺便说一句,代码与: 带有事件中心输出绑定的 Azure 函数不起作用
谢谢
解决方案
好的,我通过更改解决了:
//Send it to both cold and hot path:
var message=CreateEHMessages("aggregates", rawMessageSection, deviceId, log); outputEventHubMessageHotPath.Add(message);
outputEventHubMessageColdPath.Add(message);
至:
//Send it to both cold and hot path:
outputEventHubMessageHotPath.Add(CreateEHMessages("aggregates", rawMessageSection, deviceId, log));
outputEventHubMessageColdPath.Add(CreateEHMessages("aggregates", rawMessageSection, deviceId, log));
推荐阅读
- php - 比较PHP中的估计时间和固定时间
- javascript - 用于句子的 JavaScript 正则表达式不起作用
- c# - 如何在 C# 中截取全尺寸窗口(滚动窗口)
- excel - 正确索引新行的问题
- javascript - 以编程方式打开 lightgallery.js
- mongodb - MongoDB Scala 驱动程序 - 设置字段的问题
- python - 在 Python 中,“调用函数的主要部分”是什么?
- swift - Firebase 实时数据,如何将 .child 更改为用户输入的文本字段值
- c# - avalon 编辑器中的工具提示位置
- html - 如何避免 iphone 的引导输入字段上的额外边框顶部厚度?