Alex Rivera | Logout

Is hosting a Netty Server inside Tomcat feasible/desirable?

Asked 2010-07-07T12:11:00.203
14

We building a Netty/NIO based service, and I'm considering the deployment of this service to our production environment. Our standard way of deploying services is as WARs, to be deployed inside Tomcats.

When I suggested the same approach here, I got shouts and complaints that "it shouldn't be done", because both Netty and Tomcat are servers, and "it doesn't make sense to host one server in another".

To me it makes perfect sense because it completely solves my deployment issue, as well as saves me from writing some other code. Why is it such a big "no no" ?

Edit
Report

2 Answers

7

It makes terrific sense. We in fact run a Java email server in Tomcat.

Tomcat has some huge advantages for housing an application:

  1. The daemon scripts are already written for you
  2. Tomcat allows hot deployment (so long as you're not using hibernate :) )
  3. At some point you may need either an Admin UI or Admin API
  4. Lots and lots of tools to monitor Tomcat which means free monitoring of your app.

Now with Netty, Mina, or any event driven network technology you will not be able to use most MVC frameworks. In fact you will not be able to use most Java enterprise frameworks because many things rely on a thread per request (transactions, security, etc...).

answered 2012-01-17T14:29:37.137
1

Do not start anything in Tomcat, it is very inconvenient, and this has a lot of pain issues. Just embed Tomcat (or Jetty) inside your application and run your application as plain java process.

answered 2011-05-06T22:11:43.647

Your Answer