Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why use Tomcat or Jetty instead of a multithreaded Endpoint publisher?  RSS feed

 
mat buckland
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm designing a web server (my first in Java) and I'd like to know the benefits of using something like Tomcat over the more simple Endpoint publisher.

I'd welcome any comments or advice.
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Personally, I would use Tomcat or Jetty if I had more than one single service, that is, if there were additional web applications, EJB modules etc etc that were to be deployed on the same computer. The advantage with deploying to an application server or web container is that the container can manage resources for all the applications, services etc. running in the server/container.
If I am certain that I am only running one single service in a computer, then I would consider a standalone-alternative, perhaps Endpoint.
Note that it seems like an Endpoint can be published using an arbitrary HTTP server, so you should be able to plug in the HTTP server of your desire (to meet performance requirements, for instance).
Reference: JAX-WS 2.1 Specification, section 5.2.
Best wishes!
 
mat buckland
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ivan,

Thanks for your speedy response.

What do you mean by "to meet performance requirements, for instance"? Are you suggesting that an Endpoint publisher will only cope with a small amount of traffic?

My web server is expected to get around 500,000 hits per month. Will the Endpoint publisher model cope with that amount of traffic?

(btw does anyone have any links or references that can help me with the maze of web service possibilities for Java?)

 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I don't know how publishing using the Endpoint class with the default HTTP server performs, you will have to check it yourself. There are many factors that affect the performance of your web service, for instance: the (HTTP) server the service is running on, the design of the service, the amount of data passed to and from the service etc.
Tools I can recommend are either soapUI, that includes load testing, or Apache JMeter.
As an example I can mention that I recently developed a web service using the RESTlet framework. In its default configuration it performed OK but lost occasional requests. Having added the Grizzly extension, the performance became much better and without a single missed request.

Sorry, I don't have any links or (easy) answers concerning the Java web service's maze of possibilities. To me, it has been a long and winding road, but I feel it was/is worth it.
Best wishes!
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are certainly a LOT of server options available. Personally I would start with a known mature technology like Tomcat or Jetty and try some simulated loads before worrying about performance limits of the HTTp server.

The Grizzly server is very compact and uses the NIO library to avoid Tomcat's limit on number of simultaneous Threads.

Bill
 
mat buckland
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys. All this is very helpful.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!