I have application.yaml in springboot app as below
spring:
cloud:
gateway:
routes:
- id: pgService
uri: http://localhost:2005/
predicates:
- Path=/employee/**
- id: inMateService
uri: http://localhost:2006/
predicates:
- Path=/consumer/**
The above declared variables are with respect to spring cloud gateway
I want to declare these same variables in application.properties file. i don't want to use yaml file. please help me to achieve this Thank you
You can define the variables as follows in your application.properties file:
spring.cloud.gateway.routes[0].id=pgService
spring.cloud.gateway.routes[0].uri=http://localhost:2005/
spring.cloud.gateway.routes[0].predicates[0]=Path=/employee/**
spring.cloud.gateway.routes[1].id=inMateService
spring.cloud.gateway.routes[1].uri=http://localhost:2006/
spring.cloud.gateway.routes[1].predicates[0]=Path=/consumer/**
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With