Distributed RPC Framework

Distributed RPC Framework Apache Dubbo

Learning objectives

  • Understanding the evolution of software architecture
  • Grasp the architecture of Dubbo framework
  • Ability to start and stop Zookeeper with commands
  • Mastering Dubbo Service Providers and Consumer Development
  • Understanding Dubbo Management Console dubbo-admin

Chapter 1 - Evolution of Software Architecture

Knowledge Points - Evolution of Software Architecture

1. Goals

The development of software architecture has gone through the evolution process of monolithic architecture, vertical architecture, [SOA architecture, micro-service] architecture. We need to have a certain understanding of the evolution process of software architecture.

2. Path

  • Monomer Architecture
  • Vertical architecture
  • service-oriented architecture
  • Microservice Architecture

3. Explanation

3.1 Monomer Architecture

  1. Architectural description

    All in one.

  2. Architectural advantages

    The structure of the project is simple, the cost of early development is low, the cycle is short, and small projects are preferred.

  3. Architectural drawbacks

High coupling, poor maintenance and expansion

For large projects, post-deployment performance is low

Technology stack is limited and can only be developed in one language

High concurrency can only be solved through clustering, which is costly

3.2 Vertical Architecture

With the development of the Internet, more and more users and the great development of software technology, people began to study some technologies to make their interaction with the underlying hardware more friendly. And a system traffic access to a module accounts for a high proportion, while other modules do not have any traffic access, if they are deployed together to occupy a waste of resources, if separately deployed, high traffic deployment to a high-performance server, and low traffic deployment to a common server, the interaction between the two modules using WebSe. Access by rvice, RPC, etc. That will solve the shortcomings of the traditional architecture mentioned above.

  1. Architectural description

    Cut according to business, form small projects, projects communicate directly through RPC, exchange data and so on.

  2. Architectural advantages

    Decreased coupling

    Technology is not restricted and different systems can be developed in different languages

    The project will not expand indefinitely

  3. Architectural drawbacks

    Common logical duplication between projects, not reusable

    Interface and business logic are not separated

3.3 SOA Architecture

[External Link Picture Transfer Failure (img-8rwAnMTM-1566884463272)(img/1562381390959.png)]

As can be seen from the vertical architecture, the common logic duplication among projects can not be reused. With the development of the Internet, the scale of website applications is expanding, and the conventional vertical application architecture has been unable to cope with it.

SOA is the acronym for Service-Oriented Architecture, which is a service-oriented architecture style. From the results of service, service-based development and service, service-oriented is a way of thinking. In fact, SOA architecture is more applied to Internet project development.

  1. Architectural description

    Repetitive functions or modules are extracted into components to provide services to the outside world. ESB (Enterprise Service Bus) is used as a communication bridge between projects and services, and RPC is used to communicate.

  2. Architectural advantages

    Duplicate function or module extraction to improve development efficiency, reusability and maintainability

    Technical solutions can be formulated for different services.

    Separation of interface and business logic

  3. Architectural drawbacks

    Business is different between systems, so it is difficult to confirm that functions or modules are duplicated, which is not conducive to development and maintenance.

    Large granularity of extraction services

3.4 Microsoft Service Architecture

[External Link Picture Transfer Failure (img-GFePSjGb-1566884463284)(img/1557394132292.png)]

The limitation of SOA architecture is that all interfaces need ESB, if different programming languages develop subsystems, and this programming language is the most friendly for some RCP protocol support, while ESB rules restrict it to use only the specified ESB protocol.

  1. Architectural description

    Extending the service governance architecture, extracting finer granularity, following the single principle as far as possible, using lightweight framework protocol (HTTP protocol) transmission.

  2. Architectural advantages

    • The idea of de-centralization is not to use ESB as a bridge for communication, and services and systems can access each other.
    • Finer granularity is conducive to improving development efficiency.
    • The corresponding technical solutions can be formulated for different services.
    • Suitable for short iteration period of products
  3. Architectural drawbacks

    • Fine granularity leads to too many services and high maintenance costs.
    • Load balancing, transaction and other issues challenge technical teams and cost issues.

4. Summary

  1. Single Architecture: All modules are written in one project
  2. Vertical Architecture: System by System Extracted from Business
  3. SOA Architecture: Extracting Business into Wars
  4. Microsoft Architecture: Front-end and Back-end Separation, Back-end Development Services, Independent Deployment, Repositories

Chapter II - Apache Dubbo

Overview of Dubbo

  • Know what Dubbo and RPC are

2. Path

  • Introduction to Dubbo
  • Introduction to RPC

3.1 Introduction to Dubbo

Apache Dubbo is a high performance Java RPC framework. Its predecessor is a high performance, lightweight open source Java RPC framework of Alibaba, which can be seamlessly integrated with Spring framework.

Dubbo official website address: http://dubbo.apache.org

Dubbo provides three core capabilities: Interface-oriented remote method invocation, intelligent fault tolerance and load balancing, and automatic service registration and discovery.

Introduction to 3.2 RPC

RPC is called remote procedure call, that is, remote procedure call.

For example, two servers A and B, one application is deployed on A server, and one application is deployed on B server. The application on A server wants to call the method provided by the application on B server. Because the two applications are not in a memory space, they can not be directly invoked, so they need to express the semantics and transfer of the invocation through the network. Data used

RPC is a generalized concept. Strictly speaking, all remote procedure invocation means belong to RPC category. Each development language has its own RPC framework. There are many RPC frameworks in Java, such as RMI, Hessian, Dubbo and so on.

It should be noted that RPC is not a specific technology, not a protocol, but refers to the whole network remote invocation process.

4. Summary

  1. What is Dubbo?

    High performance RPC framework.

  2. RPC?

    Remote call, not protocol, not specific technology, is a way

  3. We can make remote calls using dubbo

Knowledge Point-Dubbo Architecture

1. Goals

  • Mastering Dubbo Architecture

2. Explanation

Dubbo Architecture Diagram (Officially provided by Dubbo) is as follows:

Node role description:

node Role Name
Provider Exposure service provider
Consumer Service consumers invoking remote services
Registry Registry of Service Registration and Discovery
Monitor Monitoring Center for Statistics of Service Call Number and Time
Container Service Running Container

The dotted lines are asynchronous access and the solid lines are synchronous access.
Blue dashed line: functions completed at startup
Red dotted lines (solid lines) are functions that are executed during program operation.

Call relationship description:

  1. The service container is responsible for starting, loading and running the service provider.
  2. At startup, service providers register their services with the registry.
  3. When service consumers start up, they subscribe to the registry for the services they need.
  4. The registry returns a list of service provider addresses to consumers, and if there is a change, the registry will push the change data to consumers based on long connections.
  5. Service consumers, from the list of provider addresses, select one provider for invocation based on the soft load balancing algorithm, and if the invocation fails, choose another one for invocation.
  6. Service consumers and providers accumulate calls and calls in memory and send statistics to the monitoring center at regular intervals every minute.

3. Summary

  1. Registry: Providers and consumers can register in the registry
  2. Provider: Let consumers make calls. Usually it's the service layer.
  3. Consumer: Remote Call Provider

Knowledge Point-Service Registry Zookeeper

1. Goals

As can be seen from the previous Doubbo architecture diagram, Registry (Service Registry) plays a vital role in it. Dubbo officially recommends Zookeeper as a service registry.

2. Path

  • Introduction to Zookeeper
  • Install Zookeeper
  • Start and stop Zookeeper

3. Explanation

3.1 What is Zookeeper

Zookeeper is a sub-project of Apache Hadoop. It is a tree-based catalog service that supports change push. It is suitable for use as a registry of Dubbo services. It has high industrial intensity and can be used in production environment and recommended for use.

To understand Zookeeper's tree directory service, let's first look at our computer's file system (which is also a tree directory structure):

[External Link Picture Transfer Failure (img-Db9dMd99-1566884463294)(img/4.png)]

My computer can be divided into multiple disk characters (e.g. C, D, E, etc.). Under each disk character, multiple directories can be created, files can be created under each directory, or sub-directories can be created, which finally forms a tree structure. Through the tree structure of the directory, we can classify the files for storage, convenient for our later search. And every file on disk has a unique access path, such as C: Windows itcast hello. txt.

Zookeeper Tree Directory Service:

[External Link Picture Transfer Failure (img-m7km8SuT-1566884463295)(img/3.png)]

Process description:

  • When a Provider starts: Write your own URL address to the / dubbo/com.foo.BarService/providers directory
  • When Consumer starts up: the provider URL address in the subscription/dubbo/com.foo.BarService/providers directory. Write your own URL address to the directory / dubbo/com.foo.BarService/consumers
  • Monitor startup: URL addresses of all providers and consumers in the subscription/dubbo/com.foo.BarService directory

3.2 Install Zookeeper

Download address: http://archive.apache.org/dist/zookeeper/. The Zookeeper version used in this course is 3.4.11

3.2.1 Windows Version
  • Unzip zookeeper

  • Modify the zoo.cfg configuration file, copy zoo_sample.cfg under conf and rename it zoo.cfg.

    • dataDir=. / Directory of temporary data storage (writable relative path)
    • ClientPort = 2181 zookeeper port number
  • Enter the bin directory and run zkServer.cmd

3.2.2 Linux version
  • Step 1: Install jdk (omitted)
  • Step 2: Upload zookeeper's compression package (zookeeper-3.4.11.tar.gz) to the linux system
  • Step 3: Decompress the compression package
tar -zxvf zookeeper-3.4.11.tar.gz
  • Step 4: Enter the zookeeper-3.4.11 directory and create the data directory
mkdir data
  • Step 5: Enter the conf directory and rename zoo_sample.cfg to zoo.cfg
cd conf
mv zoo_sample.cfg zoo.cfg
  • Step 6: Open the zoo.cfg file and modify the data attribute: dataDir=/root/zookeeper-3.4.11/data

3.3 Start and Stop Zookeeper

Enter the bin directory and start the service command

 ./zkServer.sh start

Stop Service Command

./zkServer.sh stop

View service status

./zkServer.sh status

4. Summary

  1. What is Zookeeper?

    A project is a service. dubbo recommends Zookeeper as a registry. Support change push

  2. Zookeeper installation

    • Windows version
    • LInux version

Knowledge Points - Quick Start to Dubbo

1. Goals

As an RPC framework, Dubbo's core function is to realize remote calls across networks. This section is to create two applications, one as a service provider and one as a service consumer.

Through Dubbo, service consumers can call service providers remotely.

2. Steps

2.1 Service Provider Development

  1. Create a Maven project (war), add coordinates
  2. Create business interfaces and implementation classes for registration
  3. Create application Context-service.xml (dubbo-related configuration)
  4. Configure web.xml

2.2 Service Consumer Development

  1. Create a Maven project (war), add coordinates
  2. Create Controller to register
  3. Create business interfaces and inject business into Controller
  4. Create application Context-web.xml (dubbo-related configuration)
  5. Configure web.xml

3. Realization

3.1 Service Provider Development

[1] Create a maven project (wrapped in war) dubbodemo_provider

[2] Import the following coordinates into the pom.xml file

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.xinxin</groupId>
    <artifactId>dubbodemo_provider</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <spring.version>5.0.2.RELEASE</spring.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <!-- dubbo Relevant -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>dubbo</artifactId>
            <version>2.6.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
            <version>3.4.7</version>
        </dependency>
        <dependency>
            <groupId>com.github.sgroschupf</groupId>
            <artifactId>zkclient</artifactId>
            <version>0.1</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <configuration>
                    <!-- Designated Port -->
                    <port>8080</port>
                    <!-- Request path -->
                    <path>/</path>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

[3] Create service interfaces and service implementation classes

  • HelloService
package com.xinxin.service;

/**
 * @Description:
 * @Author: yp
 */
public interface HelloService {
    String sayHello(String name);
}
  • HelloServiceImpl
package com.xinxin.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.xinxin.service.HelloService;

/**
 * @Description:
 * @Author: yp
 */
@Service
public class HelloServiceImpl implements HelloService {
    @Override
    public String sayHello(String name) {
        return "hello..."+name;
    }
}

Note: Service annotations used in service implementation classes are provided by Dubbo for publishing services to the outside world

[4] Create application Context-service.xml under src/main/resources

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
		http://www.springframework.org/schema/beans/spring-beans.xsd
         http://www.springframework.org/schema/mvc
         http://www.springframework.org/schema/mvc/spring-mvc.xsd
         http://code.alibabatech.com/schema/dubbo
         http://code.alibabatech.com/schema/dubbo/dubbo.xsd
         http://www.springframework.org/schema/context
         http://www.springframework.org/schema/context/spring-context.xsd">

    <!--Configure the application name name attribute: Take whatever you like.,Don't repeat the suggestion to write the application name-->
    <dubbo:application name="dubbodemo_provider"/>
    <!--Configure the registry address zookeeper Server ip Address port number 2181-->
    <dubbo:registry address="zookeeper://127.0.0.1:2181" />
    <!--Configuration Registration Protocol and port   The default port is 208 80-->
    <dubbo:protocol name="dubbo" port="20881"/>
    <!--Configuration package scan join@Service Annotated classes are published as services-->
    <dubbo:annotation package="com.xinixn.service"/>

</beans>

[5] Configure web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext*.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
</web-app>

3.2 Service Consumer Development

[1] Create the maven project (war) dubbodemo_consumer,

[2] Adding dependencies to pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.xinxin</groupId>
    <artifactId>dubbodemo_consumer</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <spring.version>5.0.2.RELEASE</spring.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <!-- dubbo Relevant -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>dubbo</artifactId>
            <version>2.6.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
            <version>3.4.7</version>
        </dependency>
        <dependency>
            <groupId>com.github.sgroschupf</groupId>
            <artifactId>zkclient</artifactId>
            <version>0.1</version>
        </dependency>

        <!--jackson-->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.9.0</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.9.0</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>2.9.0</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <configuration>
                    <!-- Designated Port -->
                    <port>8081</port>
                    <!-- Request path -->
                    <path>/</path>
                </configuration>
            </plugin>
        </plugins>
    </build>


</project>

[3] Create service interfaces

package com.xinixn.service;

/**
 * @Description:
 * @Author: yp
 */
public interface HelloService {
    String sayHello(String name);
}

[4] Create Controller

@Controller
@RequestMapping("/dubbo")
public class HelloController {

    @Reference
    private HelloService helloService;

    @RequestMapping("/hello")
    @ResponseBody
    public Map getName(String name){
        //Remote Call
        String result = helloService.sayHello(name);
        System.out.println(result);
        Map map =  new HashMap<>();
        map.put("result",result);
        return map;
    }

Note: Injecting HelloService into Controller uses the @Reference annotation provided by Dubbo

[5] Create application Context-web.xml under src/main/resources

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
			http://www.springframework.org/schema/beans/spring-beans.xsd
			http://www.springframework.org/schema/mvc
			http://www.springframework.org/schema/mvc/spring-mvc.xsd
			http://code.alibabatech.com/schema/dubbo
			http://code.alibabatech.com/schema/dubbo/dubbo.xsd
			http://www.springframework.org/schema/context
			http://www.springframework.org/schema/context/spring-context.xsd">

    <!-- Current application name for registry computing dependencies between applications. Note: Consumer and provider application names are not the same -->
    <dubbo:application name="dubbodemo_consumer" />
    <!-- Connect to Service Registry zookeeper ip by zookeeper Server ip address-->
    <dubbo:registry address="zookeeper://127.0.0.1:2181"/>
    <!-- Scanning Exposure Interface  -->
    <dubbo:annotation package="com.xinxin.controller" />

    <mvc:annotation-driven></mvc:annotation-driven>
</beans>

[6] Configure web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>

    <servlet>
        <servlet-name>springmvc</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <!-- Specify the configuration file to be loaded through the parameters contextConfigLocation Load -->
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:applicationContext-web.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>springmvc</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>

</web-app>

4. Summary

4.1 Provider

  • Registered @Service is dubbo

4.2 Consumers

  • The Service is injected with @Reference

5. Think about Tasks

  • Consideration 1: In the above introductory case of Dubbo, we copied the HelloService interface from the service provider project (dubbodemo_provider) to the service consumer project (dubbodemo_consumer). Is this appropriate? Is there a better way?

    Answer: This is obviously not good. The same interface has been duplicated twice, which is not conducive to later maintenance. A better way is to create a maven project separately and create this interface in the maven project. Projects that need to rely on this interface need only introduce Maven coordinates in their own project's pom.xml file.

  • Consideration 2: In the service consumer project (dubbodemo_consumer), only the HelloService interface is referenced, and no implementation class is provided. How can Dubbo make remote calls?

    Answer: The bottom layer of Dubbo is to create a proxy object for the HelloService interface based on proxy technology, through which remote calls are made. The internal structure of this proxy object can be viewed through the debug function of the development tool. In addition, the bottom layer of Dubbo network transmission is based on Netty framework.

  • In the Doubbo introductory case above, we use Zookeeper as the service registry. Service providers need to register their service information to Zookeeper. Service consumers need to subscribe to the services they need from Zookeeper. At this time, Zookeeper service becomes very important. How to prevent Zookeeper from single failure?

    Answer: Zookeeper actually supports cluster mode. It can configure Zookeeper cluster to achieve high availability of Zookeeper services and prevent single point of failure.

Keywords: Dubbo Zookeeper Spring Maven

Added by bob_dole on Tue, 27 Aug 2019 08:56:01 +0300