Netty inside Tomcat (or Jetty) ?

Elemer Pixard elpix1 at gmail.com
Wed Sep 9 20:25:44 EDT 2009


Hi,

I am developing a server which has two types of clients:
- people, browsing using HTTP and
- devices, transferring data using HTTP (j2me phones)
  and socket communication with binary protocol (proprietary devices,
android phones).

I intend to use Tomcat or Jetty for the servlet/JSP container and
Netty for the socket server.
I would prefer to have only one process to serve both HTTP and socket
communication.

I have successfully instantiated a Netty server (and also previously a
Mina server) inside
Tomcat by specifying a listener in "web.xml" which is invoked before
any servlet.
This listener creates an instance of a Netty server.
I have made very simple tests to check if the socket server was working
inside Tomcat (one or two simultaneous connections).
The socket server channel handlers will access the same database that
the http clients use (using the same connection pool, not tested yet).

This unified approach seems very convenient because with just the
web application WAR jar or directory the whole server (http and socket server)
can be deployed.

Do you see any problem in doing this or it would be preferable to develop an
stand alone server program for the socket server ?

Best regards.


More information about the netty-users mailing list