Jetty 9.0 的首個里程碑發布了
Jetty 是一個用 Java 實現、開源、基于標準的,并且具有豐富功能的 Http 服務器和 Web 容器,可以免費的用于商業行為。Jetty 這個項目成立于 1995 年,現在已經有非常多的成功產品基于 Jetty,比如 Apache Geromino, JBoss, IBM Tivoli, Cisco SESM 等。Jetty 可以用來作為一個傳統的 Web 服務器,也可以作為一個動態的內容服務器,并且 Jetty 可以非常容易的嵌入到 Java 應用程序當中。
易用性是 Jetty 設計的基本原則,易用性主要體現在以下幾個方面:
- 通過 XML 或者 API 來對 Jetty 進行配置;
- 默認配置可以滿足大部分的需求;
- 將 Jetty 嵌入到應用程序當中只需要非常少的代碼;
在使用了 Ajax 的 Web 2.0 的應用程序中,每個連接需要保持更長的時間,這樣線程和內存的消耗量會急劇的增加。這就使得我們擔心整個程序會因為單個組件陷入瓶頸而影響整個程序的性能。但是有了 Jetty:
- 即使在有大量服務請求的情況下,系統的性能也能保持在一個可以接受的狀態。
- 利用 Continuation 機制來處理大量的用戶請求以及時間比較長的連接。
另外 Jetty 設計了非常良好的接口,因此在 Jetty 的某種實現無法滿足用戶的需要時,用戶可以非常方便地對 Jetty 的某些實現進行修改,使得 Jetty 適用于特殊的應用程序的需求。
Jetty 設計之初就是作為一個優秀的組件來設計的,這也就意味著 Jetty 可以非常容易的嵌入到應用程序當中而不需要程序為了使用 Jetty 做修改。從某種程度上,你也可以把 Jetty 理解為一個嵌入式的Web服務器。
Jetty 9.0 的首個里程碑發布了,下載download the milestone測試。
9.0 版本最受關注的就是支持 SPDY, WebSockets, MUX 和 HTTP/2.0;此外該版本改進了 SSL 的支持,重構異步 HTTP 客戶端以簡化 API;該版本同時已經準備好了支持 Servlet 3.1 等等,詳細的新特性:Next Generation Protocols – SPDY, WebSockets, MUX and HTTP/2.0 are actively replacing the venerable HTTP/1.1 protocol. Jetty directly supports these protocols as equals and first class siblings to HTTP/1.1. This means a lighter faster container that is simpler and more flexible to deal with the rapidly changing mix of protocols currently being experienced as HTTP/1.1 is replaced.
Content Push – SPDY v3 supporting including content push within both the client and server. This is a potentially huge optimization for websites that know what a browser will need in terms of javascript files or images, instead of waiting for a browser to ask first.
Improved WebSocket Server and Client
- Fast websocket implementation
- Supporting classic Listener approach and @WebSocket annotations
- Fully compliant to RFC6455 spec (validated via autobahn test suite http://autobahn.ws/testsuite)
- Support for latest versions of Draft WebSocket extensions (permessage-compression, and fragment)
Java 7 – We have removed some areas of abstraction within jetty in order to take advantage of improved APIs in the JVM regarding concurrency and nio, this leads to a leaner implementation and improved performance.
Servlet 3.1 ready – We actively track this developing spec and will be with support, in fact much of the support is already in place.
Asynchronous HTTP client – refactored to simplify API, while retaining the ability to run many thousands of simultaneous requests, used as a basis for much of our own testing and http client needs.
Pluggable Modules – one distribution with integration with libraries, third party technologies, and web applications available for download through a simple command line interface
Improved SSL Support – the proliferation of mobile devices that use SSL has manifested in many atypical client implementations, support for these edge cases in SSL has been thoroughly refactored such that support is now understandable and maintainable by humans
Lightweight – Jetty continues its history of having a very small memory footprint while still being able to scale to many ten’s of thousands of connections on commodity hardware.
Eminently Embeddable – Years of embedding support pays off in your own application, webapp, or testing. Use embedded jetty to unit test your web projects. Add a web server to your existing application. Bundle your web app as a standalone application.