简体   繁体   中英

How to retrieve messages from IoT Edge Hub without using IoT Hub

I want to write a C# application which gets messages out of an IoT Edge hub on an IoT Edge device before they are sent to the IoT Hub.

I want to write an end-to-end test for my IoT edge modules. To do this, I'm going to run the whole IoT edge runtime as well as an MQTT server within a Docker container. I then want to write a test which sends data to the MQTT server from outside the container and retrieves them back by connecting directly to the IoT edge hub.

My initial architecture looks like this:

在此处输入图片说明

But I want to have something like this:

在此处输入图片说明

I still need the IoT hub to create devices on the edge, but I want to listen directly to the edge hub to retrieve messages out of my pipeline.

I could write a "test module" which does my test within the container, but that's actually not what I want to do.

So my questions are:

  1. Is this actually possible to do?
  2. Where can I get information on how to connect directly to IoT Edge hub?

The Edge hub does not have an endpoint to consume messages from the outside like the IoT Hub does. So your only solution here would be to have another custom module that you route your messages into. This module then can expose an endpoint where it would provide the incoming messages to an outside system.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM