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!
Asked
Active
Viewed 1,887 times
1 Answers
2
you have multiple options, that are depending on your use case.
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.
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

Christian Götz
- 818
- 1
- 8
- 11