Netty 3.1.0.ALPHA4 released - Chunked encoding, Idle state detection, New transports, and more.

Trustin Lee trustin at gmail.com
Mon Mar 2 07:07:38 EST 2009


Hi folks,

Netty 3.1.0.ALPHA4, the last alpha release of 3.1 branch, has been
released.  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

IdleStateHandler and Read/WriteTimeoutHandler
=============================================
We often need to take some action when a remote peer doesn't send any
data for a while or when we don't have anything to send for a while.
For example, the action taken could be either sending a 'ping' message
or closing a connection.  To implement such a behavior in Netty,
previously you had to rely on java.util.Timer or
java.util.concurrent.ScheduledThreadPoolExecutor.  As of this release,
the org.jboss.netty.handler.timeout package provides a one-stop
solution for this particular use case.

Unlike other frameworks that provide similar features, we have wrote
the internal timer implementation from scratch very carefully.  The
resulting timer implementation is highly efficient and optimized for
handling the timeouts of a large number of connections.  Also, this is
completely optional, so there is zero overhead unless you add the
handlers to a pipeline.

Chunked Encoding Support for HTTP
=================================
The most demanded feature since Netty introduced its HTTP layer was
the support for chunked encoding, and it is now part of this release.
The HTTP example (in org.jboss.netty.example.http) has been revised to
demonstrate how to deal with HTTP chunked encoding along with an
ordinary transfer coding.  Now you can build a high capacity HTTP
streaming server more rapidly than ever on top of Netty.

HTTP Tunneling Transport
=========================
HTTP Tunneling Transport (in org.jboss.netty.channel.socket.http) is a
socket transport which allows any existing socket applications to be
proxied over HTTP.  This transport is particularly useful when you
need to bypass a firewall without modifying an existing server
application.  To illustrate how this works, it looks like the
following:

    HttpTunnelingClientSocketChannel
            |
           \|/
    HTTP-friendly Firewall
            |
           \|/
    Servlet Container (e.g. Tomcat, Jetty)
            |
           \|/
    HttpTunnelingServlet
            |
           \|/
    Your Server Application

You might think we could also provide a standalone HTTP server which
is dedicated to this configuration.  Yes, that is a good idea, and any
contribution is appreciated in advance. ;)

Local Transport
===============
The local transport, as known as in-VM transport, is another long
awaited addition to 3.1.  Using the local transport, you can let your
Netty applications in the same virtual machine talk to each other
using your favorite Netty channel API without opening any actual
sockets.  It should be useful for unit testing, too.

XNIO Transport
==============
JBoss XNIO is a simplified low-level I/O layer, written by David M.
Lloyd, which can be used anywhere you are using NIO today.  It
supports TCP, UDP, and Multicast out of the box.  Therefore, we could
safely say that Netty now supports UDP via XNIO Transport.

WriteCompletionEvent
====================
So far, there was no way to figure out how many bytes (or messages)
were successfuly written for a channel.  Now, a WriteCompletionEvent
is triggered for every successful writes so that you can get the
amount of written data immediately.  With this event, you can get
meaningful statistics about a channel such as when was the last time
there was outgoing traffic in a channel.

LoggingHandler
==============
By popular demand, a LoggingHandler has been added purely for a
debugging purpose.  It logs all upstream and downstream events in
debug level.  Myself finds it very useful when I need to track down
what is going on inside a pipeline.  Also, it's a good example that
shows how to write a ChannelHandler: http://tinyurl.com/b5ogmk

Channel ID is not UUID anymore but an integer
=============================================
The return type of Channel.getId() has been changed from
java.util.UUID to java.lang.Integer.  Unfortunately, it is a backward
incompatible change which might require some changes in your code,
although the changes should be trivial in most cases.  The upside of
this change is that it will take much less memory and the string
representation of the channel ID will be much more concise.  I hope
you like the change.  Apologies!

Upcoming Releases
=================
3.1.0.ALPHA4 is the last alpha version, and we believe that we have
resolved most design issues raised since 3.0.  3.1.0.BETA1 will be
released with the fixes and minor improvements for all reported
problems from bugs to fundamental design issues.  Also, documentation
will be on its way.  Please let us know what you'd like to see in the
upcoming releases.

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

   * http://tinyurl.com/dkr4v3

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