Do you know why Netty so fire it? Compared with Mina, what advantage?

Why Netty so the fire? What are the advantages compared with Mina?

** Introduction:

As a learning Java, if not studied Netty, then you use and understanding of the Java language is merely a surface level, will point SSH, write a few MVC, database access and caching, these are just elementary Java programmers do things . If you want advanced, high-order want to know the deep knowledge of Java server, Netty is definitely a must be over the threshold **

With Netty, you can implement your own HTTP server, FTP server, UDP server, RPC server, WebSocket server, Redis's Proxy server, MySQL's Proxy server, and so on.

What Netty that? Why do you fire?

Netty is one of the most popular open source Java framework NIO framework provided by JBOSS, Netty provides asynchronous, event-driven network application framework and tools to rapidly develop high-performance, high-reliability network server and client programs.

Compared JDK native NIO, Netty provides a relatively very easy to use API, is ideal for network programming. Netty is based entirely on the NIO to achieve, so Netty is asynchronous.

As a NIO asynchronous frame, all IO operations are asynchronous non-blocking Netty, Future-Listener through the mechanism, the user can easily acquire or active operation results obtained IO notification mechanism.

Netty is undoubtedly the NIO boss, its robustness, functionality, performance, customizability and extensibility framework are second to none in its class. It has been hundreds of business / commercial validation projects, such as the Avro Hadoop RPC framework, RocketMQ mainstream and distributed communications framework Dubbo and so on.

Why such a fire, there is a reason.

Netty advantages can be summarized as follows

Simple 1, API use, lower development threshold;

2, powerful, preset a variety of codecs, supports popular protocols;

3, customization ability, the communication can be flexibly expanded by the frame of ChannelHandler;

4, high-performance, by comparison with other industry mainstream NIO framework, Netty's best overall performance;

5, mature, stable, Netty fixes have been found in all JDK NIO BUG, ​​business developers do not need to worry about the NIO BUG;

6, community activists, short version iterations, BUG discovered can be repaired in time, at the same time, more new features will be added;

7, has experienced large-scale commercial application of the test, the quality has been verified. Internet, big data, online gaming, enterprise applications, software, telecommunications and many other industries commercial success, it has proved fully able to meet the different sectors of the business applications.

What are the advantages compared with Mina?

1, are Trustin Lee's works, Netty later;

2, Mina will contact some of the features of the kernel and too closely, so that the user can not escape in time do not need these features, compared to the next performance will decline, Netty solved the design problem;

3, Netty document more clearly, have a lot of features in Mina Netty years;

4, Netty update cycle is shorter, the new release is faster;

5, their architecture is not very different, Mina by apache survive, but by Netty jboss, and combined with a very high degree jboss, Netty has support for google protocal buf, there is a more complete ioc container support (spring, guice, jbossmc and osgi);

6, Netty Mina easier to use than the process upstream events and / or downstream events Netty where you can customize, encoder and decoder may be used to encode and decode the transmitted content;

7, Netty and Mina have some differences in dealing with UDP, the UDP characteristics Netty connectionless exposed; and Mina on the UDP has been advanced level of abstraction, as can the UDP protocol "connection-oriented", but to do Netty this is more difficult.

Finally, like this article, then remember to give a point of concern, we went back every day to share articles about java

Guess you like

Origin blog.51cto.com/14456091/2424327