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.