简体   繁体   English

哪个Java网络服务器最适合这里?

[英]Which java webserver is most suitable here?

I am developing a simple web application which contains these 3 components: 我正在开发一个包含以下3个组件的简单Web应用程序:

  1. client that uses Ajax,javascript, html to display data on the browser. 使用Ajax,javascript,html在浏览器上显示数据的客户端。
  2. Java webserver that interfaces between the client and data processing entity. 客户端和数据处理实体之间接口的Java Web服务器。
  3. data processing entity, implemented in C++. 数据处理实体,以C ++实现。

I need to decide which java webserver to use. 我需要决定要使用哪个Java Web服务器。 Some options are: 一些选项是:

a) use httpserver class in java (com.sun.net.httpserver) and create a multi-threaded process. a)在Java(com.sun.net.httpserver)中使用httpserver类,并创建一个多线程进程。

b) use Glassfish server and deploy the application on it that creates the webpage,etc. b)使用Glassfish服务器并在其上部署创建网页等的应用程序。

c) use Jetty. c)使用码头。

d) ? d)?

The selection criteria for webserver is: Web服务器的选择标准是:

  1. Stability ( The process(web server) should run for days without restart) 稳定性(进程(Web服务器)应运行数天而无需重新启动)

  2. Maximum concurrent requests possible are about 200. and average case is about 30. 可能的最大并发请求数约为200。平均情况约为30。

  3. Caching is done at the webserver and requests are served from the webserver itself if data is available or not marked dirty by the data processing entity. 如果数据可用或未被数据处理实体标记为脏,则在Web服务器上进行缓存,并从Web服务器本身处理请求。

Your suggestions are greatly appreciated. 非常感谢您的建议。

Thank You. 谢谢。 Ron. 罗恩

Don't use Java's Http Server class. 不要使用Java的Http Server类。

Glassfish is nice, but probably more than you need. Glassfish很不错,但可能超出您的需要。

Jetty will work just fine. 码头会很好。

Be aware that if you're using C++ and using JNI to interface with Java, any seg faults will kill the entire server (vs like an exception in pure Java, which will just kill the request and the container can recover). 请注意,如果您使用C ++并使用JNI与Jav​​a接口,则任何段错误都将杀死整个服务器(与纯Java中的异常类似,后者将终止请求,并且容器可以恢复)。

Tomcat would be able to do this, but you should specify the requirements on the java side. Tomcat可以做到这一点,但是您应该在Java方面指定要求。 For example, are you using any J2EE functionality? 例如,您是否使用任何J2EE功能?

For caching, would you need something like JBoss cache? 对于缓存,您是否需要类似JBoss的缓存?

Are you using JNI for interfacing the Java to the C++ backend, or using an ESB, or some other approach? 您是使用JNI将Java与C ++后端接口,还是使用ESB或其他方法?

What type of data is being cached? 正在缓存什么类型的数据?

Update: Based on your information, I would suggest not using Java, but use a C++ TCP based server for this communication. 更新:根据您的信息,我建议不要使用Java,而应使用基于C ++ TCP的服务器进行此通信。 That way you don't have problems with the JNI/C++ interface. 这样,您在JNI / C ++接口上就不会有问题。 You can write a C++ server fairly easily, and if you use Boost libraries you will be close to the new C++ spec. 您可以相当轻松地编写C ++服务器,如果使用Boost库,您将接近新的C ++规范。 For threads you can look at: http://www.boost.org/doc/libs/1_40_0/doc/html/thread.html 对于线程,您可以查看: http : //www.boost.org/doc/libs/1_40_0/doc/html/thread.html

我使用树脂几年了,它非常好且稳定,建议100%使用。

我会选择Tomcat

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM