spring-cloud / spring-cloud/spring-cloud-gateway
Advanced WebClient Pool Configuration via `application.yaml`
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.9k
- Forks
- 3.5k
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 8
Description
Currently, Spring Cloud Gateway exposes only basic HttpClient settings via application.yaml, such as:
spring:
cloud:
gateway:
httpclient:
connect-timeout: 5000
response-timeout: 60s
However, Reactor Netty’s ConnectionProvider supports several advanced settings that are not exposed in the Spring Cloud Gateway configuration layer. These include:
use-global-resources: false
Use Case
These settings are critical for controlling connection reuse behavior in environments with:
Strict keep-alive or idle timeout policies (e.g., ALB, firewalls)
High-throughput microservices with connection pooling requirements
Custom tuning of backend interactions to avoid stale connection reuse
Currently, the only way to configure these is via Java configuration by injecting a ConnectionProvider manually.
Request
Please expose these advanced connection pool properties (from ConnectionProvider.Builder) through Spring Boot configuration metadata so they can be safely used in application.yaml or application.properties.
This would greatly simplify configuration in Spring Cloud Gateway and align it more closely with the capabilities of Reactor Netty.
Related Discussions
StackOverflow threads discussing this limitation
Issues about idle connection reuse causing errors
Spring Cloud Version
Tested with: Spring Cloud 2023.x, Spring Boot 3.x
Thanks for considering this enhancement!
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 Spring Cloud Gateway's HTTP client configuration into Reactor Netty's ConnectionProvider.Builder; no specific source file or test is named in the issue. Identify which advanced pool properties should be represented in Spring Boot configuration metadata, then verify that they can be set through application.yaml or application.properties and affect the gateway's connection provider.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100