实时网络应用程序,价格最小延迟 [英] Real time web application that prices with minimal delay

查看:65
本文介绍了实时网络应用程序,价格最小延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有基于Java7,Spring,JSP的应用程序



我想要将数据从一些RestService直接推送到webbrowser,没有延迟(延迟接近零)。这些是6种货币汇率。有两种情况:



1)来自REST服务的数据直接发送到浏览器而不做任何修改



2)REST服务的数据在服务器端以不同的方式对每个登录的客户稍作修改



我无法使用Flash。



我有50%的机会使用websockets(websocket框架是VertX,Spring4,Atmosphere)但我需要一些替代品。也许有一些用于http流的库?



我有openfire服务器,它用于聊天和webbrowser使用XMPP和Flash,但Flash必须更改为其他东西。聊天功能是单独的主题,我只提到当前解决方案中现有的openfire。



我怎样才能在Java webapplication中实现这一点?有两个Web应用程序需要此数据。两者都基于Spring和SpringWebflow。一个使用JSP页面,jquery,prototype。第二个使用Primefaces。



我担心使用简单的http池,因为如果有很多客户端登录,webbroswser和服务器会在很短的时间内发出太多请求。



我可以使用HTTP Streaming - 您知道Java Web应用程序中的任何库吗?

解决方案

< blockquote>根据你的描述,它看起来你需要推技术,而不仅仅是 pull ,它意味着服务器推送

https://en.wikipedia.org/wiki/Push_technology [ ^ ],

另见我过去的答案:网站帐户的应用程序信息中心 [ ^ ]。



我建议看这里:

https://en.wikipedia.org/wiki/Comet_%28programming%29 [ ^ ],

http://cometdproject.dojotoolkit.org [ ^ ],

http://wicket.apache.org [ ^ ],

http://www.javaworld.com /article/2076063/java-web-development/pushlets--send-events-from-servlets-to-dhtml-client-browsers.html [ ^ ],

http: //www.oracle.com/webfolder/technetwork/tutorials/obe/java/async-servlet/async-servlets.html [ ^ ]。



-SA


Hi,

I have application based on Java7, Spring, JSP

I want to push data from some RestService directly to webbrowser without delay (latency near zero). These are 6 currency rates. There are two scenarios:

1) Data from REST service are sent directly to the browser without any modification

2) Data from REST service are slightly modified on the server side in a different manner for every logged customer

I cant use Flash.

I have 50% chance to use websockets (websocket frameworks are VertX, Spring4, Atmosphere) but I need some alternatives. Maybe some library for http streaming?

I have openfire server and it was used for chatting and webbrowser used XMPP & Flash for that, but Flash must be changed for something else. Chatting functionality is separate topic, I only mention the openfire as existing one in current solution.

How could I achieve that in Java webapplication? There are two webapplications that want this data. Both are based on Spring and SpringWebflow. One uses JSP pages, jquery, prototype. Second one uses Primefaces.

I am worried about using simple http pooling as too many request in little time could be deadly for the webbroswser and server if many clients are logged in.

I could use HTTP Streaming - do you know any libraries for that in Java web applications?

解决方案

From your description, it really looks like you need push technology, not just pull, and it means server push:
https://en.wikipedia.org/wiki/Push_technology[^],
see also my past answer: Application 'dashboard' for website accounts[^].

I would suggest to look here:
https://en.wikipedia.org/wiki/Comet_%28programming%29[^],
http://cometdproject.dojotoolkit.org[^],
http://wicket.apache.org[^],
http://www.javaworld.com/article/2076063/java-web-development/pushlets--send-events-from-servlets-to-dhtml-client-browsers.html[^],
http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/async-servlet/async-servlets.html[^].

—SA


这篇关于实时网络应用程序,价格最小延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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