问题描述
在来自 youtube 的 tutorial 中,作者使用 Spring Cloud Gateway、Hystrix、Netflix,并使用 application.yml 配置路由,但是当我尝试从端点发送数据我只是挂在Hystrix仪表板上“加载...”,在教程中效果很好...
hystrix.stream 运行良好,把他放在 Histrix 仪表板中,只显示“正在加载”
我尝试了另一个教程,但问题仍然存在!
Maven 依赖
spring-cloud-starter-netflix-eureka-client
spring-cloud-starter-config
lombok
spring-boot-starter-data-jpa
spring-boot-starter-web
spring-cloud-starter-hystrix:2.7.3.RELEASE
<spring-cloud.version>Hoxton.SR10</spring-cloud.version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.9.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
application.yml
spring:
application:
name: API-GATEWAY
cloud:
gateway:
routes:
- id: USER-SERVICE
uri: lb://USER-SERVICE
predicates:
- Path=/user/**
filters:
- name: CircuitBreaker
args:
name: USER-SERVICE
fallbackuri: forward:/userServiceFallBack
- id: DEPARTMENT-SERVICE
uri: lb://DEPARTMENT-SERVICE
predicates:
- Path=/department/**
filters:
- name: CircuitBreaker
args:
name: DEPARTMENT-SERVICE
fallbackuri: forward:/departmentServiceFallBack
@Bean
@LoadBalanced
public RestTemplate restTemplate(){
return new RestTemplate();
}
如果使用@EnableCircuitBreaker 运行良好,问题是使用application.yml 来配置spring cloud 路由?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)