spring-cloud / spring-cloud/spring-cloud-gateway
Conditional Caching in ServerWebExchangeUtils.cacheRequestBody
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.9k
- Forks
- 3.5k
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 8
Description
For some reasons we do not limit the size of request body size.
And as a usual practise we enable RetryFilter on routes.
And here comes the problem.
When we enable the RetryFilter, the RetryFilter also enable request body caching.
Thus when the clients post a large request body, the server's memory is easilly overflowed.
However, currently, we cannot config the caching strategeis in RetryFilter/AdaptCachedBodyGlobalFilter/ServerWebExchangeUtils.
We cannot even override those classes.
This is a fatal problem and we are still figuring out a workaround...
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 request-body caching through RetryFilter, AdaptCachedBodyGlobalFilter, and ServerWebExchangeUtils.cacheRequestBody. Clarify the desired configurable caching strategy and limits before implementation; done should prevent large retry-triggered request bodies from exhausting server memory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100