Remote Call Details:
The detailed process by which a service provider exposes a service:
The above illustration is the main process by which a service provider exposes a service:
First the ServiceConfig class gets the actual class ref for the external service, and then the Getinvoker method of the Proxyfactory class uses ref to generate a Abstractproxyinvoker instance. To this step to complete the specific services to the Invoker transformation. The next step is the process of invoker conversion to exporter.
The key to Dubbo processing service exposure is the process of converting invoker to exporter, which is illustrated by the implementation of two typical protocols, Dubbo and RMI:
Implementation of Dubbo:
The invoker of the Dubbo protocol to exporter occurs in the Dubboprotocol class of the export method, which mainly opens the socket listening service and receives various requests from the client, and the communication details are realized by Dubbo.
Implementation of RMI:
The invoker of the RMI protocol is converted to exporter occurring in the Rmiprotocol class, where he implements the service through spring or Dubbo or JDK, and the communication details are implemented by the JDK bottom.
The detailed process of service consumers consuming a service
The figure above is the main process of service consumption:
First, the Referenceconfig class's Init method invokes the protocol refer method to generate the Invoker instance. Next, turn Invoker into the interface that the client needs