Tell me about how Dubbo works? Can the registration center continue to communicate after hanging up?

Interview questions

Tell me about the working principle of dubbo? Can the registration center continue to communicate after hanging up? Tell me about the process of an rpc request?

Interviewer psychoanalysis

MQ, ES, Redis, Dubbo, come up and ask you some thoughtful questions and principles , such as the principle of Kafka high-availability architecture, the principle of es distributed architecture, the principle of redis threading model, and the working principle of Dubbo; after that, you may encounter problems in the production environment. Some of the problems encountered, because the production environment may encounter some problems after the introduction of each technology; the more comprehensive one is the system design, such as letting you design an MQ, design a search engine, design a cache, and design an rpc framework and many more.

Now that we have started to talk about distributed systems, we naturally focus on dubbo first. After all, dubbo is the rpc framework standard for distributed systems in most companies at present, and a complete set of microservice architecture can also be built based on dubbo. But you need to develop it yourself.

Of course, spring cloud started to be very popular last year, and now a large number of companies have begun to turn to spring cloud. After all, spring cloud is a family bucket of microservice architecture. But because many companies are still using dubbo, dubbo will definitely be the focus of the current interview. Moreover, dubbo has restarted the open source community for maintenance and donated it to apache. It should still have a certain market and position in the future.

Now that we talk about dubbo, we must start with the principle of dubbo. You first talk about the architecture of dubbo supporting rpc distributed calls, and then talk about how an rpc request dubbo is done for you, right.

Analysis of Interview Questions

How dubbo works

  • The first layer: service layer, interface layer, for service providers and consumers to achieve
  • The second layer: config layer, configuration layer, mainly for various configurations of dubbo
  • The third layer: proxy layer, service proxy layer, whether it is a consumer or a provider, dubbo will generate a proxy for you, and network communication between the proxy
  • The fourth layer: registry layer, service registration layer, responsible for service registration and discovery
  • The fifth layer: the cluster layer, the cluster layer, encapsulates the routing and load balancing of multiple service providers, and combines multiple instances into one service
  • The sixth layer: monitor layer, monitoring layer, to monitor the number of calls and call time of the rpc interface
  • Seventh layer: protocal layer, remote call layer, encapsulation of rpc calls
  • The eighth layer: exchange layer, information exchange layer, package request response mode, synchronous to asynchronous
  • The ninth layer: transport layer, network transport layer, abstract mina and netty as a unified interface
  • Tenth layer: serialize layer, data serialization layer

work process

  • The first step: the provider to register with the registration center
  • Step 2: The consumer subscribes to the service from the registry, and the registry will notify the consumer of the registered service
  • Step 3: The consumer calls the provider
  • Step 4: Both consumer and provider notify the monitoring center asynchronously

Insert picture description here

Can the registration center continue to communicate after hanging up?

Yes, because the consumer will pull the provider's address and other information to the local cache at the beginning of the initialization , so the registry can continue to communicate after hanging up.

postscript

In this section, we introduced the working principle of Dubbo. Have you got it yet? Welcome to leave comments. More Java technologies can join my Java learning field

Guess you like

Origin blog.csdn.net/weixin_49794051/article/details/110850021