spring-cloud / spring-cloud/spring-cloud-gateway
Ability to disable connection pooling on route level
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.9k
- Forks
- 3.5k
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 8
Description
Is your feature request related to a problem? Please describe.
These days k8s is a popular solution. In the default setup typical communication looks like this: http client with connection pooling -> Kubernetes Service (which is implemented by kube-proxy - L4 load balancer) -> http server. Connection pooling + L4 Load Balancing isn't an optimal combination. Traffic can be unevenly distributed accross instances. Implementing L7 Load Balancer (through service mesh) can be costly.
Describe the solution you'd like
Ability to set up a pool mode (or just a flag - disabled/enabled) in route's metadata just like netty's connect-timeout / response-timeout. Eg. pool-mode?
Describe alternatives you've considered
- Setting up
SetRequestHeader=Connection, Closeon route, which can effectively disable connection pooling. Unfortunately this doesn't work because ofRemoveHopByHopHeaders Filter. It truncatesConnectionheader event if it's added by configuration. Anyway - i'm not 100% sure if adding this header has under the hood exactly the same effect as just disabling connection pooling on http client. - Setting up
Connectionheader by upstream in a response. But also as in alternative above i don't know if this doesn't causes another issues related to http pipelining etc. - Configuring ribbon in pod-communication mode. But we want to avoid that, because there is some eventual consistency between pod's state local copy in gateway and actual state, which causes sending requests to already dead pods during upstream rollout.
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 by tracing how route metadata is handled and where the gateway configures HTTP client connection pooling. Compare the requested route-level setting with the described Connection-header workaround and determine the behavior that must be tested. Done means a route can explicitly control pooling without affecting unrelated routes, with coverage for the configured modes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kubernetes, spring
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100