Servlet API implementation using Netty

Adam Gent picture Adam Gent · Sep 16, 2011 · Viewed 15.4k times · Source

Has anyone made a Servlet API implementation built on top of Netty? I'm tempted to build my own as I can't google an implementation.

Basically I'm looking to support just enough to get jersey working (hopefully jersey is not doing any threadlocal stuff).

Answer

Martin Matula picture Martin Matula · Sep 17, 2011

Jersey does not require servlet - runs fine even with the lightweight http server included in JDK or even runs with Grizzly NIO framework (which is similar to Netty - see grizzly.java.net). To see what it takes to make it run with Netty, you may want to look at jersey-grizzly2 module in Jersey workspace - would be nice if you would be willing to develop that and contribute to the Jersey project. Now, to disappoint you, Jersey does use ThreadLocals. We have been planning to introduce support for non-blocking async calls, but that requires a fair amount of refactoring, so will only come with 2.0 version (implementing JAX-RS 2.0 once that's final). Anyway, apart from the non-blocking stuff, it is still useful to run it on Grizzly-like framework such as Netty for its "light-weightness".