时间:2024-6-24 作者:老大夫 分类: SpringCloud
默认等待60秒钟
在openfeign的application中配置
server:
port: 80
spring:
application:
name: cloud-consumer-openfeign-order
####Spring Cloud Consul for Service Discovery
cloud:
consul:
host: localhost
port: 8500
discovery:
prefer-ip-address: true #优先使用服务ip进行注册
service-name: ${spring.application.name}
openfeign:
client:
config:
default:
#连接超时时间
connectTimeout: 3000
#读取超时时间
readTimeout: 3000
指定配置会覆盖全局配置
server:
port: 80
spring:
application:
name: cloud-consumer-openfeign-order
####Spring Cloud Consul for Service Discovery
cloud:
consul:
host: localhost
port: 8500
discovery:
prefer-ip-address: true #优先使用服务ip进行注册
service-name: ${spring.application.name}
openfeign:
client:
config:
cloud-payment-service:
#连接超时时间
connectTimeout: 3000
#读取超时时间
readTimeout: 3000
推荐阅读:
OpenFeign重试机制
OpenFeign日志打印功能
OpenFeign更换HTTPClient提升性能
OpenFeign请求压缩功能
Resilience4J的CircuitBreaker断路器之熔断
gateway 报错:Unable to find RoutePredicateFactory with name My
Resilience4J的BulkHead舱壁隔离
四种限流算法
报错:I/O error on POST request for "http://localhost:9411/api/v2/spans": Connect to http://localhost:9411 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: no further information
SpringCloud之OpenFeign负载均衡工具
行动消除疑虑