"Chapter Four Service-oriented Transformation" of "Chapter Four Service-oriented Cluster Management Dubbo High-level Actual Combat" "Chapter III Dubbo Project Practice"

"4.3.1 Analysis of service-oriented thinking of dubbo practice"

Refer to the article How to use the sandbox environment and created a sandbox account for Alipay . You can view the specific account on the Alipay open platform

"4.3.2 System Design and Reconstruction of Dubbo Practice"

"4.3.3-dubbo Practice Development and Debugging"

  • 5 23 dubbo-admin installation and how to use dubbo-admin test service on the web. Can http service pass swagger test?
  • 21 minutes to start the local service briefly, in order to avoid affecting other people’s tests, you can set the service not to be registered (that is, not to register the local service with the registration center)
  • 24 10 dubbo reference directly connects to the service provider by specifying the url
  • 31 points configuration center dubbo:config-center:address. The principle is zookeeper watch

"4.3.4-dubbo architecture actual combat flow control degradation"

  • 15 40 Dubbo's mock mechanism ( local camouflage ): usually used for service degradation, such as a certain authorization service, when the service provider all hangs up, the client does not throw an exception, but returns authorization failure through mock data.

"4.3.5-Dubbo Architecture Actual Combat Hystrix Integration"

  • 11 points:
    Insert picture description here
  • 14 points:
    // 配置项 - HystrixCommandProperties、HystrixThreadPoolProperties
    @HystrixCommand(
            threadPoolKey = "mallUserService.getUserDetailById",
            threadPoolProperties = {
    
    
                    @HystrixProperty(name = "coreSize", value = "5"),
                    @HystrixProperty(name = "maxQueueSize", value = "10"),
                    @HystrixProperty(name = "queueSizeRejectionThreshold", value = "5")
            },
            commandKey = "mallUserService.getUserDetailById",
            commandProperties = {
    
    
                    @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "2000"),
                    @HystrixProperty(name = "circuitBreaker.requestVolumeThreshold", value = "10"), // 达到条件
                    @HystrixProperty(name = "circuitBreaker.errorThresholdPercentage", value = "50"), // 异常比例 - 触发熔断阈值
                    @HystrixProperty(name = "circuitBreaker.sleepWindowInMilliseconds", value = "10000") // 熔断持续时间 - 尝试
            }
            , fallbackMethod = "back")
    public MallUser doGetUserDetailById(Long id) {
    
    
        return mallUserService.getUserDetailById(id); // 真正发起RPC调用的
    }
    
    public MallUser back(Long id, Throwable throwable) {
    
    
        MallUser user = new MallUser();
        user.setNickName("hystrix降级的结果,降级原因:" + throwable.getMessage());
        return user;
    }
  • 32 20 Spring AOP can be used to simplify configuration

"4.3.6-dubbo architecture actual combat Sentinel"

  • 6 55 Sentinel must modify not only the configuration of the service consumer, but also the configuration of the service provider
  • 25 20 Sentinel can also limit the flow of service providers

"4.3.7-dubbo architecture actual combat link tracking"

  • The overall structure of
    Insert picture description here
    skywalking : skywalking is useful to java agent:
    Insert picture description here
  • similar product:
    Insert picture description here

"4.3.8-dubbo architecture actual combat configuration center"

  • Recommended configuration center: Nacos, Apollo
  • 14 20 Dynamic loading of Nacos:
    Insert picture description here
    My question: The configuration of dubbo such as dubbo.registry.address registration center address is in zk, and the others are in nacos. Why use two configuration centers?
    Insert picture description here
    Insert picture description here
    Answer: The new version of dubbo configuration center has not yet adapted to nacos

"4.3.9-Route Adjustment for Dubbo System Maintenance"

  • 4 6 Label routing can be used to achieve traffic isolation, gray-scale release and other functions

"4.3.10-Graceful shutdown of dubbo system maintenance"

Official: Dubbo uses the ShutdownHook of the JDK to complete the graceful shutdown. Therefore, if the user uses a forced shutdown command such as kill -9 PID, the graceful shutdown will not be executed. It will only be executed when the kill PID is passed.

"Dubbo More Practice + Q&A Live"

  • 11-minute metadata center: In order to reduce the amount of data transmission

  • 19 points registration center, configuration center, metadata center:
    Insert picture description here

  • 26 points Dubbo provides an agent for service consumers and a facade for service providers

  • 33 points of suggestions for using Dubbo:
    Insert picture description here

  • 39分 Dubbo vs SpringCloud:
    Insert picture description here

  • 47 points spi. Dubbo spi official has documents

Guess you like

Origin blog.csdn.net/qq_23204557/article/details/112550704