在网页中显示动态数据的最佳方法 [英] Best way to display dynamic data in a webpage

查看:682
本文介绍了在网页中显示动态数据的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目标是在浏览器上可视化传入的数据流。我已经使用activemq对流进行排队。从队列中消耗的一条消息如下所示: int,日期/时间,int,字符串。我必须在浏览器上更新线形图(每100毫秒)。有任何想法吗?

My goal is to visualize the incoming data stream on a browser. I have used activemq to queue the stream. A single message consumed from the queue looks like this: "int,date/time,int,string". I have to update my line graph on the browser (every 100ms). Any ideas?

推荐答案

听起来像 WebSocket

有很多实现方法,但是在该主题上有一篇不错的博客文章此处

There are many ways to implement it, but a rather nice blog post on the topic is presented here.

另一种方法是使用 MQTT 直接从浏览器使用JavaScript并订阅包含您的更新的主题。在这种情况下,您必须将数据转发到该主题。为此,您可以将复合队列 forwardOnly = false

Another way is to use MQTT directly from the browser using javascript and subscribe to a topic with your updates. You have to forward your data to that topic, in this case. For that, you can use composite queues with forwardOnly=false.

这篇关于在网页中显示动态数据的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆