Netty 4.0.0.CR2 released
It's my pleasure to announce the second release candidate for Netty 4.0.0. Unfortunately, there is some API-breakage when upgrading from the previous release. We had to do this to eliminate some design issues which were found by users. Please read this post before an upgrade.
Thanks again to everyone who helped us fix issues and make the release even more stable.
You can grab the release from our download page and from the Maven central repository.
If you have any feedback please let us know, we really appreciate them.
Backward-incompatible changes
Please read this section before upgrading to CR2.
ChannelHandler
and its sub-types
ChannelHandler.beforeAdd/Remove(...)
was removed because it made it very difficult to fulfill the thread model while not blocking at all.ChannelHandler.afterAdd/Remove(...)
was renamed tohandlerAdded/Removed(...)
.
This may not affect any of your code if you not made use of those and just extended the Adapter classes.
ChannelInbound/OutboundHandler
and its sub-types
- Removed
ChannelInboundHandler.freeInboundBuffer()
andChannelOutboundHandler.freeOutboundBuffer()
because it's not useful anymore since we introduced reference counting in the previous releases.
This may not affect any of your code because you usually extend *Adapter
s and don't override the mentioned methods.
Codec framework
encode(...)
anddecode(...)
now take aMessageBuf<Object>
as a parameter and returnvoid
. Therefore, once you encoded or decoded a message, you have to add the message to theMessageBuf<Object>
given as a parameter. This change simplifies message handling by enabling the removal of automatic array unfolding.
This will most likely affect you if you wrote a codec based on the codec framework.
SslHandler
SslHandler.handshake()
was renamed tohandshakeFuture()
for consistency. Also, it now returns aFuture<Channel>
instead of aChannelFuture
.SslHandler.closeNotifyFutre()
returns aFuture<Channel>
instead of aChannelFuture
.
ByteBufHolder
and its sub-types
ByteBufHolder.data()
was renamed tocontent()
. The sub-types, for instance, includeHttpContent
,SctpMessage
,SpdyDataFrame
, andWebSocketFrame
.
ChannelPipeline
ChannelPipeline.remove/replaceAndForward(...)
has been merged intoremove/replace()
.
Bootstrap
and ServerBootstrap
ServerBootstrap.shutdown()
andBootstrap.shutdown()
were deprecated. Please use theEventExecutorGroup.shutdownGracefully()
method instead. See the next section for more information.
EventExecutorGroup
and EventLoopGroup
- Fixed the API contract violation against
java.util.concurrent.ExecutorService
with respect to theExecutor
life cycle. EventExecutorGroup.shutdown()
has been deprecated byshutdownGracefully()
. UseshutdownGracefully()
wherever possible to avoid any trouble such as resource leak during a shutdown.
Changes in general
This release fixed 90 issues. It's highly recommended to upgrade as soon as possible. We'd like to apologize that the upgrade process might not be as smooth as 'dropping the new JAR', but we believe all the changes were really worth the pain before going final.
Besides all the fixes, this release also ships with a few new features which may be worth some more details:
- #762 adds
WebSockeClientHandler
which makes it super easy to write WebSocket clients with Netty. See the apidocs for more details. - #1207 adds
WebSocketFrameAggregator
which can be used to aggregate partial frames. - #1244 allows to pass
DefaultChannelTransferPromise
tosendFile(..)
operation to keep track of the transfer progress.
Visit here for the complete list of the changes.