Apache MINA

by Robert Cooper

Related link: http://www.theserverside.com/news/thread.tss?thread_id=37227

Apache MINA is out. This is a multi-protocol server framework that includes a lot of neat stuff. Most notably it is used as the core for ApacheDS which I have written about before. As someone who has gotten... snookered, as it were... into writing some low level protocol type stuff, this is easy for me to appreciate.

At the same time, I have to wonder: What ever happened to "Servlet"? Not HttpServlet or JSP or Struts, but the original idea of the servlet that was supposed to be a protocol independent network processor? I had this exact same question, actually, when Apache gave us the Mailet API as well. It really seems like the framework proliferation is getting more and more out of hand. And yes, right tool for the right job and all that, but having some good 80/20 frameworks coming from the standards people (Sun, IBM?) that everyone can easily understand is important to the language.


2005-10-25 15:27:12
Apache MINA and the Servlet API
I must admit that Apache MINA API resembles some important features; custom attributes and a filter chain. But we didn't want any other properties provided by ServletRequest and ServletResponse such as locales, input/output stream, path, include/forward, character encoding, and many more. These properties implies that Servlet API assumes a stream-based sequential data (mostly text) protocol. MINA is developed to support asynchronous I/O, full control over binary data manipulation and abstraction, and more flexible thread model that we cannot fulfill simply with InputStream and OutputStream.
2005-10-25 15:30:56
I forgot to mention that I also think it would be great if there's some new standard in this area we can conform to.

On the other hand, I believe MINA is designed to process all kinds of protocols available in this world, and I have to make it so if it is not. We're always open to others' opinion. It's still 0.8. :)

2005-10-25 18:02:59
Apache MINA and the Servlet API
Again, I don't mean to imply that MINA lacks some special functionality that is lacking in the Servlet API per say. Nor would I say that Mailet lacks a similar level of functionality adapted to the Email world.

What I am missing, though, is why the Servlet (as opposed to HttpServlet) hasn't adapted over time. I won't even go out to say that JAMES or MINA aren't valuable in their own right. At the same time, I look at thinks like the Message-Driven bean spec, various flavors of SOAP over SMTP vs SOAP over HTTP, and I can't help but wonder why there isn't a more generic Servlet/Filter chain API as part of the core that people could implement these types of functionality off of, rather that the constantly expanding numbers of so very similar APIs.

I can accept that Mailet, HttpServlet and MINA all have their (acceptable) differentiation, but it seems to me that there is definitely a base for "Servlet" that can serve as the basis for all of these. As it was presented at advent, this was the purpose of "Servlet" that seems to have gotten lost.

2005-10-25 18:03:38
Apache MINA and the Servlet API
*per se :P