Spring Cloud Load Balancer multiple configurations中提出的类似问题。
我想同时为 spring 云负载均衡器使用运行状况检查和相同实例偏好配置。无法提供多个配置。
我正在使用 SimpleDiscoveryClient 列出实例。此外,如果这两种配置都被合并,它可以替代粘性会话负载均衡器规则吗?
在这里发布我的 yml:
spring:
application:
name: sample
cloud:
discovery:
client:
health-indicator:
enabled: false
simple:
instances:
test-service:
- uri: http://localhost:8082
- uri: http://localhost:8081
loadbalancer:
# configurations: health-check
configurations: same-instance-preference
sticky-session:
add-service-instance-cookie: true
cache:
enabled: false
health-check:
path:
default: /actuator/health
interval: 10000
gateway:
routes:
- id: test_routing
path: /user/*
uri: lb://test-service
predicates:
- Method=GET,POST
- Path=/user/**
server:
port: 45000