spring-cloud / spring-cloud/spring-cloud-gateway
Allow to pass port to `uri` value and replace Eureka port with this value
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.9k
- Forks
- 3.5k
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 8
Description
Allow to pass port as configuration parameter. For example uri would look like this:
.route(p -> p
.path("/sentence-service/**")
.filters( f-> f
.rewritePath(
"/sentence-service/(?<segment>.*)", "/$\\{segment}")
.retry( 3 )
)
.uri( "lb://SENTENCE:8081" )
)
.build();
In this case Gateway will fetch path info from Eureka, but will use port 8081
Extend ReactiveLoadBalancerClientFilter class. Check if port is passed. If so, replace port from Eureka with the one passed.
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.
Research direction
Start at ReactiveLoadBalancerClientFilter and trace how the route URI and Eureka instance data are combined. Done means a port supplied in the lb URI replaces Eureka's port while routing still uses Eureka path information; without a supplied port, existing behavior remains.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100