spring-cloud / spring-cloud/spring-cloud-gateway
Adding Routes Dynamically to gateway
Open
@ryanjbaxter is already working on this.
Since Aug 26, 2019.
enhancement
- Dominant language
- Java
- Stars
- 4.9k
- Forks
- 3.5k
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 8
Description
Need to add service registered with Eureka server as routes dynamically to spring cloud gateway.
Have got it working using
spring.cloud.gateway.discovery.locator.lowerCaseServiceId: true
spring.cloud.gateway.discovery.locator.enabled: true
spring.cloud.gateway.discovery.locator.predicates[0].name: Path
spring.cloud.gateway.discovery.locator.predicates[0].args[pattern]: "'/api/'+serviceId+'/**'"
spring.cloud.gateway.discovery.locator.filters[0].name: StripPrefix
spring.cloud.gateway.discovery.locator.filters[0].args[_genkey_0]: 1
Can someone help me in converting this to Java Code? Need to do this to use readBody() which we cannot do in yaml files as per https://github.com/spring-cloud/spring-cloud-gateway/issues/690
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.