用于推送通知的Node.js或Vert.x. [英] Node.js or Vert.x for Push Notifications

查看:119
本文介绍了用于推送通知的Node.js或Vert.x.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个java应用程序,服务器需要每隔一秒向客户端发送推送通知。我正在使用HTML5服务器发送事件来完成从服务器到客户端的单向通信。但是,我希望在连接到服务器以获取更新的任何时间点都有> 1000个客户端连接(肯定会增加)。这些更新的持续时间也可能持续30分钟。我已经读过在这种情况下使用简单的html5服务器发送事件时,服务器可以快速耗尽线程,严重影响性能。

I have this java application where the server needs to send push notifications to the client every one second. I am using the HTML5 server sent events to accomplish the one-way communication from the server to the client. However, I am expecting >1000 client connections (which will surely increase) at any point in time connecting to the server to get updates. The duration of these updates may run into 30 mins also. I have read that under such situations when using simple html5 server-sent-events, the server can quickly run out of threads, severely affecting performance.

评估我来了跨越Node.js和vert.x,它们都能够执行服务器发送的事件操作。在检查哪个是更好的选项时,我在以下链接中找到 http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple-http-benchmarks/ vert.x优于Node .js文件。

On evaluation I have come across Node.js and vert.x both of which have the ability to perform server sent events operations. On checking which is a better option, I found on the following link http://vertxproject.wordpress.com/2012/05/09/vert-x-vs-node-js-simple-http-benchmarks/ that vert.x outperforms Node.js.

根据现有的信息,我无法做出明智的决定,考虑到我只想用它来实现,哪个项目对我的项目来说是更好的选择服务器发送的事件。我的主要考虑因素是当有大量请求时的性能。任何人都可以根据他们的经验帮助我,node.js是更好的选择还是vert.x?

Based on the information available I am not able to make an informed decision as to which will be a better option for my project considering that I only want to use them for achieving server-sent-events. My main consideration is performance when there are large number of requests.Can anybody please help me based on their experience, whether node.js is a better option or vert.x?

谢谢。

推荐答案

根据我的经验,vertx性能远离nodejs,它大大优于节点,但是vertx仍然是实验性的而不是100%稳定,更糟糕的是,最新版本(vertx 3)打破了与vertx 2的兼容性,它还没有文档..

in my experience the vertx performance is far away from the nodejs, it outperforms to node for a big margin, but vertx is still experimental and not 100% stable, even worse, the latest version (vertx 3) breaks the compatibility with vertx 2 and it has not documentation yet..

如果你只需要vertx用于通信服务器/客户端那么它应该不那么难,你可以在现有应用程序中嵌入vertx

if you only need vertx for communication server/client then it shouldn't be so hard, you can embedded vertx inside your existing app

http://perfectworldprogramming.com/embed-vert-x-eventbus-into -your-spring-application-with-ease /

现在,对于更复杂的东西,nodejs可能会更好和更多经过测试的解决方案,但如果你在jvm并且你的应用程序处于高级阶段,可能你必须保留在jvm生态系统中,可能是vertx,akka或netty ...祝你好运,你的选择,vertx,akka ,netty和node是非常好的异步解决方案

now, for more complex stuff nodejs could be a better and more tested solution, but if you're in the jvm and you app is in an advanced stage, probably you must keep in the jvm ecosystem, could be vertx, akka or netty...good luck with your choice, vertx,akka,netty and node are really good async solutions

这篇关于用于推送通知的Node.js或Vert.x.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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