Abstract:

Dubbo is a distributed services framework dedicated to providing high-performance and transparent RPC remote service invocation solutions, as well as SOA service governance solutions. To put it simply, Dubbo is a service framework. If there is no distributed requirement, there is no need to use a distributed service framework such as Dubbo, and only when distributed, there is a need for a distributed service framework such as Dubbo, and essentially a service invocation east east, which is a distributed framework for remote service invocation (say goodbye to the Web)

WSdl in Service schema, registered on Dubbo as both server and consumer)

1. What is Dubbo?

Dubbo is a distributed services framework dedicated to providing high-performance and transparent RPC remote service invocation solutions, as well as SOA service governance solutions. To put it simply, Dubbo is a service framework. If there is no distributed requirement, there is no need to use a distributed service framework like Dubbo, and it is essentially a service invocation. Basically, a distributed framework for remote Service invocation (moving away from WSdl in the Web Service pattern and registering on Dubbo as a server and consumer)

Its core parts include:

1. Remote communication: provides abstract encapsulation of a variety of long-connection-based NIO frameworks, including multiple threading models, serialization, and “request-response” mode of information exchange.

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

3. Automatic discovery: based on the registry directory service, so that service consumers can dynamically find the service provider, so that the address is transparent, so that the service provider can smoothly add or reduce machines.

2. What can Dubbo do?

1. Transparent remote method invocation, which calls remote methods just like local methods, with simple configuration and no API intrusion.

2. Soft load balancer and fault tolerance mechanism can replace hardware load balancer such as F5 on the Intranet to reduce costs and single points.

3. Automatic service registration and discovery, no longer need to write the service provider address, registry based on the interface name query service provider IP address, and can smoothly add or delete service providers.

Dubbo uses a full Spring configuration mode to transparently access applications without any API intrusion. You only need to load Dubbo’s configuration with Spring. Dubbo is loaded based on Spring’s Schema extension.

3. Dubbo’s architecture

The Dubbo architecture diagram is shown below:






Node roles:

Provider: exposes the service Provider of the service.

Consumer: Service Consumer that invokes the remote service.

Registry: A Registry where services are registered and discovered.

Monitor: monitors The Times and time of service invocation.

Container: service running Container.

I think this is very good, clear role, according to the status of each node role to determine whether the service is normal.

Call relationship description:

The 0 service container is responsible for starting, loading, and running the service provider.

1. At startup, service providers register their services with the registry.

2. At startup, service consumers subscribe to the registry for the services they need.

3. The registry returns the service provider address list to the consumer, and if there are changes, the registry will push the change data to the consumer based on the long connection.

4. The service consumer selects one provider from the provider address list to invoke based on the soft load balancing algorithm. If the invocation fails, the service consumer selects another one to invoke.

5. Service consumers and providers accumulate call times and call time in memory, and regularly send statistical data to the monitoring center once a minute.

Dubbo’s fault tolerance is obvious, and the performance has not been tested yet. A page in our system needs to drop the interface for 5 times. We would have suggested making a cache, but the business relationship cannot be adopted, so we need to study the performance tuning of Dubbo…

4. How to use Dubbo.

Dubbo uses a full Spring configuration mode to transparently access applications without any API intrusion. You only need to load Dubbo’s configuration with Spring. Dubbo is loaded based on Spring’s Schema extension. If you don’t want to use the Spring configuration and want to call it through the API (not recommended)

Let’s take a step-by-step look at how dubbo is used

Please follow me to learn dubo-ZooKeeper Registry Installation (2).

The core technology: Maven, for Springmvc mybatis shiro, Druid, Restful, Dubbo, ZooKeeper, Redis, FastDFS, ActiveMQ, Nginx

1. Screenshot of the core code structure of the project






Willing to understand the framework technology or source code of friends directly ask to exchange technology: 2042849237

Some distributed solutions, friends who are willing to understand can find our team to discuss

More detailed source code reference source: minglisoft.cn/technology