I'm quite new to spring cloud gateway, please bare with me for my ignorance.
I have 1 spring cloud gateway at localhost:8999 and 2 microservice instances named memberat localhost:8085 & localhost:8086. I also have a service discovery (Spring Cloud Eureka) and using Spring Load Balancer. I have registered all the gateway and application instances through eureka server at localhost:8761. Everything works fine and the gateway is able to load balance between both member instance using the default load balancing (round robin):
eureka:
instance:
prefer-ip-address: true
client:
service-url:
defaultZone: http://localhost:8761/eureka/
spring:
main:
web-application-type: reactive
application:
name: custom-gateway
cloud:
gateway:
routes:
- id: member-route
uri: lb://member
predicates:
- Path=/api/**
server:
port: 8999
If I shutdown 1 of the member instance at port 8085, it seems like spring cloud gateway is not smart enough to detect and still load balances to the instance that is down which result in this error:
What I would like to know is, are there any way for me to configure the gateway to automatically detect the down instance and only load balances to the healthy instances?
