如何从自定义边缘模块 运行 Apache Nifi 与 Azure IoT Edge 运行时交互

How to interact with Azure IoT Edge Runtime from custom Edge Module running Apache Nifi

我们的边缘设备基于 Azure IoT Edge 运行时。负责数据处理的模块之一是自定义模块 运行 Apache Nifi 的一个版本。 处理的输出应该通过 IoT 中心转到 Azure IoT Edge 消息总线 and/or 到云上游。

有人知道如何连接边缘系统的那些部分吗? 我们是否必须在自定义模块上编写 C# 代码才能完成此操作,还是有其他方法可以完成此操作?

编辑:

经过进一步调查,我了解到我可以根据 ModuleClient 的 this and interaction with the local Message Bus should be able by writing a custom Nifi Processor as shown here using the Java SDK 使用 MQTT 连接到 IoT Hub,只需提供正确的连接字符串并确保自定义容器可以通过以下方式到达主机IP.

您认为我的假设对实现我们的目标是否正确?

你的假设是正确的。您必须使用 Java Azure IoT SDK ModuleClient class 编写自定义 Nifi 处理器。我在 spring-boot-iotedge-sample of my Java Azure IoT Edge samples at https://github.com/JMayrbaeurl/azure-iotedge-java-samples

中做了一些非常相似的事情