简体   繁体   中英

How to subscribes to topic on mqtt broker with Azure IOT HUB as i want the data to be stored in Azure iot hub when I published my topic

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

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.

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