Question

I want to make an app that sends realtime mqtt data. The backend will catch this mqtt stream. I need this data to manipulate a realtime graph on a webpage. How can I do this? What are the best practices to handle this realtime data? Should I process every incoming mqqt request? Any help is appreciated!

Était-ce utile?

La solution

you have multiple options, that are depending on your use case.

  1. Use Eclipse Paho JavaScript to directly connect to the MQTT broker from within the web browser. I have done a similar use case as you descirbe at EclipseCon Europe. A Java client publishes random data and the web page shows a temperature gauge and other charts. Code and slides are available here.

  2. Let your MQTT broker save all publishes to a database (see best practises). For getting the data to the browser I would recommend a REST API. With this option you can easily show historic data.

Hope that answers your question.

Cheers, Chris

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top