1

By following the instruction with below code:

const { EventHubClient } = require('@azure/event-hubs');

async function main() {
  const client = await EventHubClient.createFromIotHubConnectionString(process.env["IOTHUB_CONNECTION_STRING"]);
  const hubInfo = await client.getHubRuntimeInformation();
  console.log(hubInfo);
  await client.close();
}

main().catch((err) => {
  console.log(err);
});

I could read Azure IoT Hub messages from built-in endpoints. However, when I route message to a custom endpoint (e.g. Azure Storage containers, Event Hubs), I could no longer read the message.

It there any tool or SDK to help me to read all messages arrived in IoT Hub no matter where the message will be routed?

Jun Han
  • 13,821
  • 7
  • 26
  • 31
  • 2
    the following route will do it: Endpoint: events, DataSource: Device Telemetry Message, RoutingQuery: true – Roman Kiss Oct 15 '18 at 06:17

1 Answers1

1

Please note that once a Route is created, data stops flowing to the built-in-endpoint unless a Route is created to that endpoint.

Here is a Device Explorer tool, we can use to monitor messages from your devices, and send messages to your devices

If you want to read all messages arrived in IoT Hub no matter where the message will be routed, just add the built-in-endpoint to routes, then you will be able to monitor the data using that tool. Device Explorer

Tony Ju
  • 14,891
  • 3
  • 17
  • 31
  • Thanks! With built-in endpoint added to route, we could also use the cross-platform [Azure IoT Toolkit](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-toolkit) to monitor the messages. – Jun Han Oct 15 '18 at 11:56
  • @JunHan You can accept it as answer to help others.Thank you. – Tony Ju Jun 05 '19 at 08:22