Skip to content

fix(httpclient): cache request body for replay during retry#6414

Open
eye-gu wants to merge 2 commits into
apache:masterfrom
eye-gu:fix/6413-retry-body-replay
Open

fix(httpclient): cache request body for replay during retry#6414
eye-gu wants to merge 2 commits into
apache:masterfrom
eye-gu:fix/6413-retry-body-replay

Conversation

@eye-gu

@eye-gu eye-gu commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Fixes #6413

When retry is enabled, exchange.getRequest().getBody() (a single-use FluxReceive) is exhausted after the first attempt. Retry subscriptions emit onComplete immediately, so upstreams receive an empty body — silent data loss with no error logged.

Add getCachedRequestBody(): DataBufferUtils.join → read byte[] → .cache() → Flux.defer(wrap) per subscription.

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Retry sends empty request body when the original body stream is single-use

2 participants