We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
自定义ribbon为RandomRule, 消费方是user,需要依次调用其他两个微服务instr 和infra, 第一次远程调用正常,第二次远程调用instr,负载到的服务却是infra,如下图 注意到掉用instr和infra的RandomRule是一个,想问下什么原因,如何处理? pom依赖如下:
<properties> <spring.cloud-version>Hoxton.SR8</spring.cloud-version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring.cloud-version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.10.1</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>2.3.2.RELEASE</version> </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.6.2</version> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-openfeign</artifactId> </dependency> </dependencies>
The text was updated successfully, but these errors were encountered:
spring默认扫描配置类为单例模式,配置为原生模式就可以解决问题。或者按照官网不要将其RibbonConfig放在spring扫描的包下,同时配置ribbon配置为自定义的ribbonConfig,那么会在远程调用时进行初始化,也能解决上面的问题。
Sorry, something went wrong.
No branches or pull requests
自定义ribbon为RandomRule,
消费方是user,需要依次调用其他两个微服务instr 和infra, 第一次远程调用正常,第二次远程调用instr,负载到的服务却是infra,如下图
注意到掉用instr和infra的RandomRule是一个,想问下什么原因,如何处理?
pom依赖如下:
The text was updated successfully, but these errors were encountered: