I work with Spring to create microservices. I am using Eureka for service discovery and Spring cloud gateway for routing. I would want to auto-route for the number of services I am having.
For example if one service 'eureka-client' registers to Eureka, and for routing with Spring Cloud Gateway, I've to create a route all by myself for each service like following.
routes:
- id: eureka-client
uri: lb://eureka-client
predicates:
- Path=/eureka-client/**
With a few services that's acceptable but I might get hundreds of services in the end. And each has to write its own route in Spring Cloud Gateway. I have used spring.cloud.gateway.discovery.locator.enabled=true and doesn't solve the issue. Basically I am trying to eliminate the routes config in the yaml file.
Is there a way to provide auto routing from Spring Cloud Gateway to each service from Eureka?
I am getting 404 as it was not able to get the proper routing Any help would be appreciated. Thanks.