Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Analysis of important Concepts of Dubbo

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

In this issue, the editor will bring you an analysis of the important concepts of Dubbo. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

1.proxyFactory: just to get a proxy class for an interface, such as a proxy for a remote interface.

It has two methods, representing two functions.

A.getInvoker: wraps a service object, such as DemoServiceImpl, into an Invoker object for the server side.

B.getProxy: for the client side, create a proxy object for the interface, such as the interface for DemoService.

2.Wrapper: similar to spring's BeanWrapper, it wraps an interface or class, and you can assign values to instance objects and make method calls through wrapper.

3.Invoker: it is an executable object that can get the corresponding execution result according to the name and parameters of the method.

There is a very important method Result invoke (Invocation invocation) in it.

Invocation contains important information such as methods and parameters that need to be executed. At present, there are only two implementation classes RpcInvocation MockInvocation.

It has three types of Invoker

1. Invoker of the local execution class

Server side: to execute demoService.sayHello, just use InjvmExporter to reflect and execute demoService.sayHello.

two。 Invoker of remote communication class

Client side: to execute demoService.sayHello, it encapsulates DubboInvoker for remote communication and sends the interface to be executed to the server side.

Server side: use AbstractProxyInvoker to execute DemoServiceImpl.sayHello, and then send the execution result back to client.

3. The Invoker of multiple remote communication execution classes are aggregated into a cluster version of Invoker

Client side: to execute demoService.sayHello, load balancing is done through AbstractClusterInvoker, DubboInvoker communicates remotely, and the interface to be executed is sent to the server.

Server side: use AbstractProxyInvoker to execute DemoServiceImpl.sayHello, and then send the execution result back to client.

4.Protocol

1.export: to expose a remote service (for the server side) is to expose the proxy class invoker object created by proxyFactory.getInvoker to the outside through the protocol.

2.refer: reference remote services (for clients) to create remote dynamic proxy classes, such as DemoService's remote dynamic interface, through proxyFactory.getProxy.

5.exporter: maintains the lifecycle of invoder.

6.exchanger: information exchange layer, encapsulating request response mode, synchronous conversion.

7.transporter: network transport layer, which is used to abstract the unified interface between netty and mina.

8.Directory: directory service

StaticDirectory: static directory service, whose Invoker is fixed.

RegistryDirectory: register the directory service, whose Invoker collection data comes from the zk registry. He implements the NotifyListener interface and callback notify (List urls).

The whole process has an important map variable, methodInvokerMap (which is the source of data; it is also an important object of operation for notify, focusing on write operations. )

The above is the analysis of the important concepts of Dubbo shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report