In Spring Cloud Gateway, we have too many routes in one application yaml. I am trying to break them into individual routes and import them into main/parent yaml.
Tried below approach of spring.profile.include but it is only loading the last route definition (instead of all those defined). Code sample below
File 1: application-route1.yml
spring:
cloud:
gateway:
route[0]:
- id: employee-route
uri: http://localhost:8085
predicates:
- Path=/employee/**
File 2: application-route2.yml
spring:
cloud:
gateway:
routes:
- id: consumer-route
uri: http://localhost:8086
predicates:
- Path=/consumer/**
Main Parent File:
spring:
application:
name: edge-gateway-service
profiles:
include: >
route1,
route2
Here only route2 is loaded.
Appreciate any help/suggestions