dubbo service discovery

        The framework should never stay in the stage of use. The purpose of Ali's code specification is to code quality and code efficiently. Code is an action and needs to be practical. Personally, I don't like "code". If I give a demo to high school students now , they can also write a business implementation called by an RPC framework. That's why read source (high) code (salary).

        Explore the core of dubbo: RPC implementation principle, detailed process of RPC from sending request to receiving return result, RPC load balancing principle, service exposure, service discovery principle and implementation details, how dubbo does it in multithreading The return results are corresponding to each thread one by one, and afterward think about how to design an excellent RPC business process.

       The last service registration was implemented based on API, this time service discovery is implemented based on spring container. The Spring container will convert ReferenceConfig to ReferenceBean,

Obtain the server information from the registration center, and the code idea is consistent with the service registration.

        Consumer subscriptions subscribe to service provider information in the registry. The FailbackRegistry implementation used by default, where retry is a timed task in the background. RegistryProtocol.doRefer involves zookeeper subscription and cluster cluster fault tolerance.

        After completing the conversion of the invoker object, the invoker object contains the url of the server and the url of the consumer. The routing rule is followed by the creation of dynamic proxy objects (the creation of dynamic proxy objects includes jdk, cglib, and javassist).

        The RPC remote call is made in the generated dynamic proxy object InvokerInvocationHandler. return invoker.invoke(new RpcInvocation(method, args)).recreate().

        Dubbo is far more than that, there are also load balancing algorithms; network communication netty non-blocking, blocking, asynchronous, synchronous; tcp sticking and unpacking; serialization, etc.

        I will continue my springboot series later.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325942762&siteId=291194637