Netty 3.1.0.BETA1 released - HTTP Improvements & UDP transport

Trustin Lee tlee at redhat.com
Mon Mar 16 05:00:55 EDT 2009


Hi folks,

Netty 3.1.0.BETA1, the first beta release of 3.1 branch, has been
released.  The Netty project is an effort to provide an asynchronous,
event-driven network application framework and tools for rapid
development of maintainable, high-performance, high-scalability
protocol servers and clients. In other words, Netty is a NIO client
server framework that enables quick and easy development of network
applications such as protocol servers and clients. It simplifies and
streamlines network programming such as TCP and UDP socket servers.
Please visit our web site to download it:

   * http://www.jboss.org/netty/

As always, your feed back is more than appreciated.  Please visit the
discussion forum and leave some comments and questions:

   * http://www.jboss.org/netty/community.html

HTTP Improvements
=================
There were a number of improvements in the HTTP codec.  The most
important change is the emulation of chunked encoding.  Previously, a
large HTTP message was loaded into a large memory buffer taking up as
much space as the length of the content and headers.  It will simply
fail when your HTTP server is under heavy load.  To address this
issue, HttpMessageDecoder now splits a large request or response into
a multiple chunks making it looks like a chunked message.

The advantage of this change is that you have much more control over
OutOfMemoryError when you write a media / file server on top of Netty.
 The disadvantage is that your handler needs to understand HttpChunk
message type, too.  To learn how to deal with HttpChunks, please take
a look at the revised HTTP client / server example:

   * http://tinyurl.com/5w3fpb - see HttpRequestHandler and HttpResponseHandler

Alternatively, you can append HttpChunkAggregator to the pipeline to
let Netty merge HttpChunks just like the previous releases.  This
handler is useful when you prefer simplicity over memory efficiency.
For more information, please check this forum thread:
http://tinyurl.com/cqb7hy

Besides the chunk emulation, you can now limit the length of headers
to avoid unnecessary memory consumption due to malicious or malformed
HTTP message.  HTTP cookie encoder and decoder have been improved
vastly, too; cookie version 0, 1, and 2 are all supported.

UDP Transport
=============
UDP transport, the very long-awaited feature, has been implemented.
It's not NIO based but old I/O based.  It should perform fine because
most UDP applications don't open many sockets because one socket is
supposed to serve datagrams from different remote addresses.  Plus, it
does support multicast.  I wrote the 'Quote of the Moment' (QOTM)
example that shows the basic usage of the UDP transport.  As a bonus,
you will enjoy some inspiring quotes from Gandhi. :)

   * http://tinyurl.com/dyswam

CompatibleObjectDecoder Deprecated
==================================
I had to deprecate CompatibleObjectDecoder due to a known yet
incurable critical issue.  If you were using it, please switch to
ObjectEncoder, ObjectDecoder, ObjectEncoderOutputStream, and
ObjectDecoderInputStream.  For more information, please check the
related JIRA issue: https://jira.jboss.org/jira/browse/NETTY-136

If you have a good idea to make it work correctly, please let me know.
 Then we might be able to un-deprecate it.

Upcoming Releases
=================
If there's no noticeable bugs and I have done enough documentation and
testing, the next release will be 3.1.0.CR1 (Candidate Release).
Otherwise, it will be 3.1.0.BETA2.  Please keep us updated with any
bugs, design issues, API usability feed back, and questions.

Miscellaneous
=============
For the full changelog, please visit here:

   * http://tinyurl.com/c6f5pb

Again, as always, your feed back is more than appreciated.  Please
visit the discussion forum and feel free to leave some comments and
questions:

   * http://www.jboss.org/netty/community.html

Cheers,

— Trustin Lee, http://gleamynode.net/




More information about the netty-users mailing list