Learning Netty – HTTP Echo

Learning Netty – Part 1

I recently picked up a copy of Netty in Action – which has been a great to learn more about Netty. I’ve become more fascinated with Netty as I’ve delved farther into Reactive & Asynchronous programming. Netty is a very powerful framework that simplifies a lot of the challenges with NIO programming however it is still difficult to find resources / examples of every day use cases.

Echo HTTP

Many examples online start with building an Echo Server & Client. However they use a simple TCP echo server – which although probably more reasonable for the server doesn’t show a barebones HTTP setup.

The following is a Gist of a barebones setup of setting up an HTTP server and client. The example shows a few simple defaults such as the use of HttpObjectAggregator, HttpServerCodec and SimpleChannelInboundHandler.

2 Replies to “Learning Netty – HTTP Echo”

  1. I had no idea you are a techie too! I’ve read your reporting in Newsweek and more recently followed you on Podcasts (like with Sam Harris for example). Thanks for this Netty example, it was useful to improving my understanding of this NIO library.

Leave a Reply

Your email address will not be published. Required fields are marked *