Build your own communication framework — Introduction

Posted on

Build your own communication framework — Introduction


Since my work, I have been doing business development under the framework set up by others. I have gone through the source code of the framework and generally understood the implementation principle. However, only by doing so, it is difficult to understand the author’s thinking when designing, and it is easy to ignore some technical details. Therefore, I came up with the idea of developing my own framework. This is not to build a wheel repeatedly, but just to put myself in a higher perspective, In the process of design, it drives deep thinking. For the first project, I’m going to develop a communication framework and write a series of articles to record my thoughts and choices in the design process.



A simple MVC communication architecture based on netty

  • Support websocket protocol

  • Custom protocol package format

  • client requestAsynchronous serial lock free

  • RPC support(future)

Dependencies and tools

  • JDK13

    My own project is not considered to be used in actual production, and new features will be used as much as possible in the development process

  • Gradle

    The ability of gradle’s custom script is quite convenient. There is a place in my plan that I will use. Moreover, gradle script supports groovy, so I can learn this language

  • Netty

    Excellent communication infrastructure.

  • Protobuf

    It can be used in language independent, platform independent and extensible communication protocols, data storage and other fieldsSerialization structure data format

  • Groovy+Spock

    Test framework, written more concise

  • hu-tool

    Toolset, there are many easy to use tools

  • Spring Boot

    Dependency management, logging, monitoring, etc.

  • lombok

    Leave out get, set, constructor, etc

  • IDEA

    Invincible IDE

Function priority

Develop in the following order

  1. Custom protocol format for interaction with client
  2. Request, response encapsulation
  3. Nettyserver build
  4. Asynchronous serial lock free


About a week ago, I began to write this framework, but after a few days of writing, I found that this is not right, the development process is not right, and often wrote that I found that this is not right, there is not right, and a lot of thinking has been slowly forgotten. After reflection, I decided to combine the article to review the whole design process. Encourage each other.

In this paper, the blog group issued a multi article and other operational tools platformOpenWriterelease

Leave a Reply

Your email address will not be published.