Take the city of netty, from now on!


Hello, I’m Tong Ge, the operator of “Tong Ge read source code“, the owner of technology company.

In fact, when I first studied netty, I was also very confused. One day, a colleague received an offer from Ali. He was going to work as a middle platform in Ali. Before leaving, he secretly told me to have a look at netty, especially the source code.

After that, I read almost all the books and blogs about netty on the market, and followed the examples in the book while reading and practicing. However, in the end, I found that in terms of knowledge about netty, I just changed from an apprentice to a skilled worker, and I still had no deep understanding of netty, because many books or blogs explained netty from the perspective of use For the core knowledge and underlying principles, the explanation is very little, or very incomplete.

So, I decided to do it myself and roll up the source code of netty. Not long after, I found that my knowledge of netty was growing rapidly, and I understood a lot of the underlying principles of Java more thoroughly. Thanks to this, I later entered a domestic Internet game company as the platform architecture design and implementation.

This is my own experience of learning from netty. Now, you can think about your situation.

Do you always want to learn java network programming, but don’t know how to get started?

Are you going to finish watching netty or just write entry-level examples?

Is it right to learn from other open source frameworks and be at a loss as soon as you go deep into the communication layer?

Is it true that during the interview, when we talk about netty, we can only simply talk about the execution process of the request? For the lower thread pool, object pool and memory pool, I don’t know?

If you are in this situation, you are not alone. This is not a problem you encounter alone. In my work, I like to communicate with people and find that many students, new or old, have superficial mastery of netty.

After he went to Ali, the first challenge he met was that his leader asked him to finish learning Dubbo in a week and make a PPT to share with the whole group. For him who has never learned Dubbo, you may say that it is too difficult and almost impossible. However, it took Dubbo only five days to complete the report.

I think his in-depth understanding of netty accounts for a large proportion of this. Later, he told me that, in fact, there are only so many things to learn in the Java field, and the most important thing is to master the underlying core knowledge. After mastering these core knowledge, learning other things is really half the effort, which is also the secret of his rapid learning and success.

So, as a java developer, what are the underlying core knowledge?

Nothing more than reflection, proxy, multithreading and, of course, NiO. How can we learn and master these knowledge quickly?

I think the source code is a good way, whether it’s the source code of Java itself or the source code of open source framework.

As a de facto standard in the field of Java network programming, netty is undoubtedly the most appropriate.


From the figure above, we can see that many familiar frameworks in Java are using netty. Moreover, these frameworks cover all fields of Java, including but not limited to big data, RPC, message queue, search engine, database, etc.

Therefore, I want to do a course about netty, hoping that through this course you can really master the underlying core knowledge of netty.

So, how will I design this course?

According to my own experience in learning and using netty, I divide the whole course into six modules to explain:


Basic knowledge, introduce the development history of netty, and learn the basic knowledge of Java network programming. Only by laying a good foundation can we get twice the result with half the effort;

Source code analysis — data flow, analyze the source code from the perspective of data flow, including service startup, receiving data, closing connection, etc., and quickly master the basic process of netty application operation. This part of the source code can use extensive reading skills to quickly read and understand the general process;

Source code analysis — core knowledge, analyze the source code from the perspective of core knowledge, including memory pool, object pool, thread pool, etc., go deep into the bottom, master the core points, this part of the source code needs intensive reading, to each knowledge point to the end;

Project practiceFrom the perspective of software development life cycle, this paper introduces how to use netty to develop a production level game project;

Advanced combat, continuously optimize the actual combat projects to make them more stable, faster, safer and more reliable, and introduce how to quickly check production problems;

Course summaryMake a summary and review of the whole course.


Click the link to view the course detailshttps://www.imooc.com/read/82

I’m grateful to the colleague who secretly told me that I wanted to see netty. It was undoubtedly a very important turning point in my life.

Without that colleague’s whispering, I might not be who I am today. I hope this column can also become a turning point in your life.

Finally, I hope that through this column, I can not only help you learn the underlying core knowledge of netty, but also deepen your understanding of the underlying core knowledge of Java, help you win the city of netty and pass through the important moments of your career and life!

Pay attention to the official account “Tong brother read the source code”, unlock more source code, infrastructure and architecture knowledge.