Use Jetty or Netty?

30,311

Jetty has had support for asynchronous request processing since version 6 (see here), using a proprietary API. More recent versions support the asynchronous API as part of the Servlet 3.0 API, like any other compliant implementation.

Using Netty would seem like a lot of work for little gain, unless you have highly specific requirements. Otherwise, Jetty would do the job for you with minimal effort.

Share:
30,311
ccleve
Author by

ccleve

Updated on December 27, 2020

Comments

  • ccleve
    ccleve over 3 years

    We're in the process of writing a high-performance server for processing messages. We've been using Jetty for several years and like it, but Netty looks like it has some cool features. In particular, it has support for asynchronous processing so a thread doesn't have to be tied up waiting for the system to process a given message. It's designed to solve the C10k problem.

    I know that Jetty has some support for NIO internally. Does it also have an asynchronous model?

    The messages are likely to be in http format. Does Netty have any performance advantages over Jetty when doing plain old http?

    I'd like to have all the convenient features of a real servlet container, but not at the cost of reduced performance.

  • ccleve
    ccleve over 12 years
    Good advice, although we've decided to go with Netty. The servlet 3.0 api for async support is convoluted. It's hard to follow what's going on and easy to mess up. Plus, Netty is going to be a lot better for low-level protocol handling in the future. But your answer is a good one.
  • Erik Kaplun
    Erik Kaplun over 10 years
    @skaffman: have any pointers to some articles/blogs where Jetty vs Netty is discussed in more detail? from the point of view of should one use Netty or stick with Jetty (or Tomcat or whatnot)