Skip navigation

Netty 5.0.0.Alpha3 released

We are happy to announce the third Alpha release of the upcoming netty 5.0.0. This release is another big milestone for us and the community, towards the eventual final release of Netty 5. This release migrated all of our code to use the new Buffer API And completely removed ByteBuf. Beside this there are a lot of other exciting changes included.

These are the major changes since Alpha 2:

  • All code now uses Buffer (our new buffer API).
  • Remove ChannelInboundHandler
  • Remove Http2MultiplexCodec and Http2MultiplexCodecBuilder
  • A number of convenience methods have been added to Buffer, EventLoop, Future
  • ChannelHandlerContext does not extend AttributeMap anymore
  • Make half-closure a core-concept of Channel
  • Allow sending "custom" events in both direction
  • Remove blocking methods from Future interface, people need to use Future.asStage() to gain access to blocking methods
  • Remove Channel.Unsafe
  • Remove ChannelOutboundBuffer from the Channel API as its an implementation detail of AbstractChannel
  • Remove @Sharable and replace it by ChannelHandler.isSharable()
  • Remove EventLoop.Unsafe and add EventLoop.registerForIo(...) / EventLoop.deregisterForIo(...)
  • Allow ChannelHandler to buffer outbound data and influence Channel.isWritable() by adding ChannelHandler.pendingOutboundBytes(...)
  • Rename Channel.bytesBeforeUnwritable() to Channel.writableBytes()
  • Add ProtocolEvent and let SSL and WebSocket implementation use it
  • Add EventLoopGroup.isCompatible(...) method which allows to check if a Channel subtype is compatible with a given EventLoopGroup / EventLoop
  • Don't restrict SocketChannel / ServerSocketChannel to InetSocketAddress and so make it possible to use the JDK implementation for unix domain sockets with netty
  • Move common logic into AbstractChannel and so make it easier for implementations to re-use code. Also rename protected methods to be more consistent

For more details on all the changes that went into this release please check our issue tracker.

To make it easier to experiment with netty 5 while still use 4.1 at the same time, we have put Netty 5 into its own io.netty5 package. This allows to have both version co-exist at the same time. As this a new major version we also started to introduce breaking changes where it makes sense. These changes were mostly motivation by lessons learned during the life-time of netty 4.1.x. We really hope you enjoy these changes and if not provide feedback in what we should address :)

We will soon start to change the default branch of netty to main and so be more strict about changes that will be accepted for 4.1. While this might sound like a "limitation" it will help to keep the possibility of a regression to a minimum for 4.1. Important bugfixes will of course still be ported to 4.1 as well. With all this said we don't plan to stop supporting 4.1.x any time soon. Both versions will be supported in parallel for now.

To help users to try the next major version of netty we started to write down all the "required" things to do in terms of migrating netty 4.1.x code to 5.0.0. The migration guide can be found on our website.