简体   繁体   中英

Which java webserver is most suitable here?

I am developing a simple web application which contains these 3 components:

  1. client that uses Ajax,javascript, html to display data on the browser.
  2. Java webserver that interfaces between the client and data processing entity.
  3. data processing entity, implemented in C++.

I need to decide which java webserver to use. Some options are:

a) use httpserver class in java (com.sun.net.httpserver) and create a multi-threaded process.

b) use Glassfish server and deploy the application on it that creates the webpage,etc.

c) use Jetty.

d) ?

The selection criteria for webserver is:

  1. Stability ( The process(web server) should run for days without restart)

  2. Maximum concurrent requests possible are about 200. and average case is about 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.

Your suggestions are greatly appreciated.

Thank You. Ron.

Don't use Java's Http Server class.

Glassfish is nice, but probably more than you need.

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).

Tomcat would be able to do this, but you should specify the requirements on the java side. For example, are you using any J2EE functionality?

For caching, would you need something like JBoss cache?

Are you using JNI for interfacing the Java to the C++ backend, or using an ESB, or some other approach?

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. That way you don't have problems with the JNI/C++ interface. You can write a C++ server fairly easily, and if you use Boost libraries you will be close to the new C++ spec. For threads you can look at: http://www.boost.org/doc/libs/1_40_0/doc/html/thread.html

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

我会选择Tomcat

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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