Introduction to Dubbo and integration with SpringBoot (code address attached)

Introduction

Dubbo is a distributed service framework dedicated to providing high-performance and transparent RPC remote service invocation solutions
and SOA service governance solutions. Simply put, dubbo is a service framework, if not distributed demand, in fact,
do not need to use, only when distributed, have dubbo demand for such a distributed service framework, and this
is a service call on quality Dongdong, to put it bluntly, is a distributed framework for remote service calls

core part

1. Remote communication: Provides abstract encapsulation of a variety of NIO frameworks based on persistent connections, including multiple thread models, serialization, and information exchange methods in the "request-response" mode.

2. Cluster fault tolerance: Provides transparent remote procedure call based on interface methods, including multi-protocol support, and cluster support such as soft load balancing, failure tolerance, address routing, and dynamic configuration.

3. Automatic discovery: Based on the registration center directory service, the service consumer can dynamically find the service provider, make the address transparent, and enable the service provider to smoothly add or reduce machines.

What can Dubbo do

1. Transparent remote method call, just like calling a local method to call a remote method, only simple configuration, no API intrusion.

2. The soft load balancing and fault tolerance mechanism can replace hardware load balancers such as F5 in the intranet, reducing costs and reducing single points.

3. Automatic service registration and discovery, no need to write down the address of the service provider, the registration center queries the IP address of the service provider based on the interface name, and can smoothly add or delete service providers.

Dubbo architecture

Insert picture description here

Character introduction
Provider: 暴露服务的服务提供方。

Consumer: 调用远程服务的服务消费方。

Registry: 服务注册与发现的注册中心。

Monitor: 统计服务的调用次调和调用时间的监控中心。

Container: 服务运行容器。
Call relationship
1. 服务容器负责启动,加载,运行服务提供者。

2. 服务提供者启动时,向注册中心注册自己提供的服务。

3. 服务消费者启动时,向注册中心订阅自己所需的服务。

4. 注册中心返回服务提供者地址列表给消费者,如果有变更,注册中心将基于长连接推送变更数据给消费者。

5. 服务消费者,从提供者地址列表中,基于软负载均衡算法,选一台提供者进行调用,如果调用失败,再选另一台调用。

6. 服务消费者和提供者,在内存中累计调用次数和调用时间,定时每分钟发送一次统计数据到监控中心。

Usage: SpringBoot integrated Dubbo code case

Guess you like

Origin blog.csdn.net/mrhs_dhls/article/details/107707332