What's the difference between Jetty and Netty?

前端 未结 3 1294
青春惊慌失措
青春惊慌失措 2021-01-29 18:37

What is the main difference between Jetty and Netty?

Netty is part of Jboss, but is it the default web server container?

Does Netty support Servlets 3.0?

3条回答
  •  自闭症患者
    2021-01-29 19:18

    I think over time the overlap increases as both projects add new features.

    Here is a benchmark: https://gist.github.com/dhanji/81ccc0e6652eccaf43cf

    Jetty is a web server (HTTP), similar to the likes of Tomcat and such, but lighter than most servlet containers. This is closer to the traditional Java way of doing server applications (servlets, WAR files). Like Netty it is sufficiently lightweight to be embedded into Java applications.

    Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. It greatly simplifies and streamlines network programming such as TCP and UDP socket server. So Netty is focusing on helping to write NIO/non-blocking, asynchronous network programs.

    If you deal a lot with network protocols and want it to be non-blocking use Netty (usually for high-performance cases). If you want a light HTTP servlet container use Jetty.

    • Also see: Use Jetty or Netty?
    • Alternatives to Netty: What are the Netty alternatives for high-performance networking?
    • Articles about Netty: http://netty.io/wiki/related-articles.html
    • Servlet 3.0 with Netty: http://www.jroller.com/agoubard/entry/run_servlets_with_netty#.Vtb0Teaunjs
    • Servlet bridge for Netty: https://github.com/bigpuritz/netty-servlet-bridge

提交回复
热议问题