Service consumer
-
Dynamic Proxy: Proxy- Generates dynamic Proxy objects
-
Load balancing: Cluster, load balancing, failover
-
Communication protocols: Protocol, filter mechanism, HTTP, RMI, duBBo and other protocols
-
Different network protocols send requests in different request formats
-
-
Information Exchange: Exchange, Request and Response
-
For the Request data organized in your protocol format, you need a wrapper, Request
-
-
Network communication framework: Transport, Netty, mina
-
Serialization: How to serialize wrapped requests into binary arrays and send them out over Netty/MINA
Service provider
-
Network communication (including deserialization) : Transport, request listening based on netty/ Mina implementation Server
-
Information Exchange: Exchange, Response
-
Parsing a Request
-
-
Communication Protocol: Protocol, filter mechanism
-
Provides services that resolve requests according to specific protocols
-
-
Dynamic Proxy: Proxy
Dubbo Underlying Communication Principle (NetTY)
-
First, an Acceptor thread in netty polls the ServerSocketChannel for network events through the Selector component. The ServerSocketChannel listens for its port number and perceiving connections and service requests.
-
Once the connection is established with the service consumer, the ServerSocketChannel generates a SocketChannel (one SocketChannel for each service consumer)
-
There are several processor threads (with Selector components) polling socketchannels for service requests.
-
The service provider then parses the request and responds after providing the service
-
The response is sent through the Processor thread to the SocketChannel, and then through the SocketChannel in the Netty framework of the service provider to the SocketChannel in the Netty framework of the service consumer
-
In the Netty framework of service consumers, there are also processor threads (with Selector components) polling socketChannel for network events and receiving responses from providers.