I have a legacy app(HTTP and raw TCP) that uses traditional BIO (blocking IO) and I’d like to start replacing it with Netty.
How does Netty work with traditional BIO clients? Are there any issues if I first replace the server component with Netty and leave the BIO clients in place?
Additionally, can a Netty built server replace a typical HTTP Web Server intended to server Browser clients? Any issues there?
Thanks
My understanding is that netty supports blocking (
org.jboss.netty.channel.socket.oio) and non blocking (org.jboss.netty.channel.socket.nio) operations. See http://docs.jboss.org/netty/3.2/guide/html/architecture.html section 2.2.It is easy to switch between blocking and non-blocking so you can try with NIO and if that does not with with your clients, you can switch to OIO. You set the type of IO you wish to support with you setup to ChannelFactory
There are a number existing netty based HTTP web server/framework already implemented. For example, webbit, xitrum and play framework. I’m sure there are more. These are just the ones I can think of off the top of my head.
If you wish to implement your own, a good starting point is the examples in the
org.jboss.netty.example.httppackage.