Introduction and selection of Java Network Communication framework based on NIO

Source: Internet
Author: User
Tags jboss

Java NiO framework Mina, Netty, Grizzly Introduction and comparison MinaMina (Multipurpose Infrastructure for network applications) is a relatively new project for the Apache organization that provides a very convenient framework for developing high-performance and high-availability Web applications. The current release of Mina version 2.04 supports Java NIO technology-based TCP/UDP application development, serial communication programs, Mina supported by further expansion of the functions.  Currently, applications that are using Mina include: Apache Directory Project, Asyncweb, AMQP (Advanced Message Queuing Protocol), RED5 Server (Macromedia Flash Media RTMP), Objectradius, OpenFire, and more.


NettyThe Netty is an asynchronous, event-driven Network application framework and tool for rapid development of maintainable high-performance, high-scalability protocol servers and clients. In other words, Netty is a NIO client/server framework that enables rapid and simple development of network applications such as protocol servers and clients. It greatly simplifies network programming, such as TCP and UDP socket servers.


GrizzlyGrizzly is an application framework that specifically addresses the various issues that arise when writing thousands of users to access a server. Use Java NiO as a foundation and hide the complexity of its programming. An easy-to-use, high-performance API. Bring non-blocking socketd to the protocol processing layer. Leverage high-performance buffer and buffer management to use high-performance thread pooling.


OK, we can now look at the simple comparison of the three.
First of all, from the concept of design, Mina's design philosophy is the most elegant. Of course, because the leading author of Netty and Mina's leading author is the same person, from the same person's hand netty in the design concept and Mina are basically consistent. Grizzly is less of a design concept, almost a simple package for Java NIO.
Second, from the point of view of the project, Mina was born in the open source world of the Daniel Apache organization, Netty from the commercial open source tycoon JBoss, and Grizzly was born in the Earth Turtle Sun Company. From their origins can see the application of a wide range of procedures, so far, I see the industry or use more Mina, and Netty is also slowly applied, and grizzly seems to be only Sun's own project use, if there are other companies or open source projects in use, then even if I ignorant.

Finally, from the introductory documentation, the official and civil documents are considerably more common than the introductory examples due to the relatively long Mina time. Netty's official documentation is also well done, and civilian documents are less likely to be compared to Mina. As for Grizzly, both official and civil, they seldom see their documents.


Mina and Netty How to choose the recommended solution

Netty basic architecture and Mina almost exactly the same, the use of the same time thinking, but there are many details of the improvement.
such as Google protocal BUF support, such as the more complete IOC container support (SPRING,GUICE,JBOSSMC and OSGi), but also behind the support of commercial companies such as JBoss, the official boast performance than Mina and grizzly excellent. And it seems that the support for the custom threading model described on the document should be much better than the Mina document.

In fact, what I value most is the support of JBoss, which makes the project full of vitality, at least for the time being more diligent than the Mina update.
So if you choose, I still recommend you choose Netty.

Introduction and selection of Java Network Communication framework based on NIO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.