Hi Maarten,

Now my question is, does anyone have good or bad experience running
a MINA app inside tomcat ?
Does anyone foresee any problems with that approach ?

Based on my personal experience, what you can do to put a Mina Network
Application inside a WAR is:
1). You create a MinaAppServlet
2). In MinaAppServlet.init(), you start your Mina Application, such as
   create SocketAcceptor and listening
3). In MinaAppServlet.destroy(), you stop your Mina Application
4). Your MinaAppServlet.doGet() can only be used to expose some
    status info of your Mina Application since this is not real Servlet
    you just leverage a Web Container to start and stop your Mina
    Application.

The cons of this approach is obvious:
1. HttpServlet is not designed for this purpose
2. If your Mina Application will be running as a heavy loaded server,
  you load the Tomcat with it to compete the resource of one JVM

If you develop your Mina Network Application to be a front-end to
accept TCP/IP based message and pass them to a back-end, a better
approach would be that you wrap your Mina Network Application
as a Java Resource Adapter (J2EE JCA 1.5), then you can package it
as RAR to deploy into a J2EE Container, such as Apache Geronimo,
then message will be passed down to MDB for further back-end
processing.

This is my 2cents and hope it would be helpful.

Thanks,

Jian




On 1/29/07, Maarten Bosteels <[EMAIL PROTECTED]> wrote:
Hello,

Until now my MINA-based applications were stand-alone java apps, started
from the command-line.
To add some management features, I embedded jetty and wrote some basic
servlets.
But now I am wondering if it wouldn't be easier to just create a regular
web-app and deploy it in Tomcat
(or any other servlet container)

All our other applications are webapps, so the deployment would be more
uniform
and for the management features I could use the MVC framework that I am used
to (Spring MVC + velocity).

Now my question is, does anyone have good or bad experience running a MINA
app inside tomcat ?
Does anyone foresee any problems with that approach ?

Thanks,
Maarten


Reply via email to