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

What is the hierarchical design of dubbo?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article focuses on "what is the hierarchical design of dubbo", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the hierarchical design of dubbo?"

Dubbo hierarchical design:

Config configuration layer: external configuration interfaces, centered on ServiceConfig and ReferenceConfig, can initialize configuration classes directly, or generate configuration classes through spring parsing configuration

Proxy service proxy layer: transparent proxy of service interface, generating client-side Stub and server-side Skeleton of service, taking ServiceProxy as the center, and extending interface to ProxyFactory

Registry registry layer: encapsulates the registration and discovery of service addresses, with service URL as the center, and extended interfaces as RegistryFactory, Registry, RegistryService

Cluster routing layer: encapsulates the routing and load balancing of multiple providers, bridges the registry, takes Invoker as the center, and extends the interfaces for Cluster, Directory, Router, LoadBalance

Monitor monitoring layer: monitoring the number and time of RPC calls, taking Statistics as the center, and extending the interfaces for MonitorFactory, Monitor, MonitorService

Protocol remote call layer: encapsulates RPC calls, centered on Invocation and Result, and extended interfaces for Protocol, Invoker, Exporter

Exchange information exchange layer: encapsulates the request response mode, changes synchronously to different steps, takes Request and Response as the center, and extends the interfaces for Exchanger, ExchangeChannel, ExchangeClient, ExchangeServer

Transport network transport layer: abstract mina and netty as unified interfaces, Message as the center, and extended interfaces as Channel, Transporter, Client, Server, Codec

Serialize data serialization layer: some reusable tools, extension interfaces are Serialization, ObjectInput, ObjectOutput, ThreadPool

Dubbo design principles:

Using Microkernel + Plugin mode, Microkernel is only responsible for assembling the functions of Plugin,Dubbo itself, which is also realized through extension points, that is, all function points of Dubbo can be replaced by user-defined extensions.

URL is used as the unified format of configuration information, and all extension points carry configuration information through URL.

Dubbo registry

Multicast registry: the Multicast registry does not need to start any central node, as long as the broadcast address is the same, it can discover each other.

Zookeeper registry: Zookeeper is a sub-project of Apacahe Hadoop and a tree directory service that supports change push. It is suitable to be used as a registry for Dubbo services with high industrial intensity and can be used in a production environment. It is recommended that Ali does not use a zookeeper registry.

Redis registry: Ali does not use a Redis registry internally, but uses a database-based registry.

Use Redis's Key/Map structure to store data structures:

The main Key is the service name and type

Key in Map is the URL address

The Value in Map is the expiration time, which is used to judge dirty data, which is deleted by the monitoring center [3].

Use the Publish/Subscribe event of Redis to notify data changes:

Event types are distinguished by their values: register, unregister, subscribe, unsubscribe

Ordinary consumers subscribe to the Key of the specified service provider directly, and only receive the register and unregister events of the specified service.

The monitoring center will receive all change events for all services through psubscribe subscriptions / dubbo/*,.

Simple registry: the Simple registry itself is a common Dubbo service that reduces third-party dependence and makes the overall mode of communication consistent.

At this point, I believe you have a deeper understanding of "what is the hierarchical design of dubbo?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Servers

Wechat

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

12
Report