Article Directory
- "4.3.1 Analysis of service-oriented thinking of dubbo practice"
- "4.3.2 System Design and Reconstruction of Dubbo Practice"
- "4.3.3-dubbo Practice Development and Debugging"
- "4.3.4-dubbo architecture actual combat flow control degradation"
- "4.3.5-Dubbo Architecture Actual Combat Hystrix Integration"
- "4.3.6-dubbo architecture actual combat Sentinel"
- "4.3.7-dubbo architecture actual combat link tracking"
- "4.3.8-dubbo architecture actual combat configuration center"
- "4.3.9-Route Adjustment for Dubbo System Maintenance"
- "4.3.10-Graceful shutdown of dubbo system maintenance"
- "Dubbo More Practice + Q&A Live"
"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"
-
Press https://nacos.io/zh-cn/docs/quick-start.html to download and install nacos, use the address http://ip:8848/nacos/#/login to open the web console of nacos, by default The username and password are both Dubbo in the nacos
reference officer. Nacos will become the registration center . Set dubbo.registry.address to nacos://ip:8848?namespace=abd78ed2-7fcc-488d-882d-012025f41999. If you set it on the console In terms of namespaces.
"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:
- 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
skywalking : skywalking is useful to java agent:
- similar product:
"4.3.8-dubbo architecture actual combat configuration center"
- Recommended configuration center: Nacos, Apollo
- 14 20 Dynamic loading of Nacos:
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?
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:
-
26 points Dubbo provides an agent for service consumers and a facade for service providers
-
33 points of suggestions for using Dubbo:
-
39分 Dubbo vs SpringCloud:
-
47 points spi. Dubbo spi official has documents