fangjian0423 / deep-in-spring-cloud-samples Goto Github PK
View Code? Open in Web Editor NEW《深入理解 Spring Cloud 与实战》配套示例代码
Home Page: https://item.jd.com/13043028.html
License: Apache License 2.0
《深入理解 Spring Cloud 与实战》配套示例代码
Home Page: https://item.jd.com/13043028.html
License: Apache License 2.0
书中版本:
<properties>
<spring-cloud-alibaba.version>2.2.0.RELEASE</spring-cloud-alibaba.version>
</properties>
此版本用的 nacos-client
是 1.1.4,会出现超时,对应issue:alibaba/nacos#2206
我这改为:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${spring-cloud-alibaba.version}</version>
<type>pom</type>
<scope>import</scope>
<exclusions>
<exclusion>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<version>1.4.1</version>
</dependency>
</dependencies>
</dependencyManagement>
在灰度发布配置时,不应该使用 NacosRibbonEnhanceConsumer 中的
@Bean public IRule myRule() { return new GrayRule(); }
此方式会导致在多个不同名称的服务中的路由分配时出现错误(调用服务A,该路由分配到了服务B上),应使用
@RibbonClients(defaultConfiguration = {GrayRule.class})
若不同服务使用不同的路由,可使用
@RibbonClients(value = { @RibbonClient(name = "A", configuration = GrayRuleA.class), @RibbonClient(name = "B", configuration = GrayRuleB.class) })
~
43页右下角的"hello"接口。这个案例讲的是使用ReactiveDsicoveryClient获取服务实例并切用WebClient这种reactive客户端调用服务,所以这里获取服务实例不应该通过DiscoveryClient而是通过ReactiveDsicoveryClient。并且这个类也不应该出现DiscoveryClient
deep-in-spring-cloud-samples/chapter02/spring-cloud-alibaba-nacos-consumer-reactive/src/main/java/deep/in/spring/cloud/NacosReactiveConsumer.java /
这里的schema应该是scheme吧,为此我专门查询了
https://github.com/spring-cloud/spring-cloud-gateway/blob/b69b7145a4588de7212230a332958429c71efda8/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/filter/ForwardPathFilter.java#L42
以及jdk中的URI代码。
如果是我理解有误,这里的确是schema,就十分抱歉哈~~~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.