0
votes

im new to mqtt and currently trying to setup a mqtt protocol to send data from a gateway devices to azure iot hub. The problem i facing was I couldn't figure out which way that I can received and store data on IoT Hub when i published my data on mqtt broker. The textbook way is to subscribe the mqtt broker using Azure IOT Hub but how should I do it?

Assuming I am doing testing using a laptop

Read data stored in json file -> published to topic "data/device1" -> Data stored in Azure IoT Hub

I tried reading the Azure IoT HUB MQTT Connections but it doesnt work out for me. PLease Help

1

1 Answers

0
votes

By default Azure IoT Hub makes incoming telemetry messages available on its Event Hub-compatible endpoint: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-messages-read-builtin It does not matter over which protocol (MQTT, AMQP or HTTPS) you sent in the messages to IoT Hub - they all will land in that endpoint.

From there you can read the information using HTTPS or AMQP. I would recommend to use the Event Hub SDK or use a stream processing service like Azure Stream Analytics or Spark Streaming, which supports Event Hub directly.