Skip to content

WebClient retry() doesn't re-run filters #23909

@Anusien

Description

@Anusien

Calling retry() on a Mono<> produced by calling WebClient.exchange() won't re-run the filters. This means any modifications made to the request by filters (like changing the URL for load-balancing purposes) won't be repeated.

DefaultWebClient seems to run all the filters synchronously, including generating the URL. Then DefaultExchangeFunction calls ClientHttpConnection. It's the http connection that does the actual connection asnychronously, producing a Mono<>. Specifically, filters get run when you call exchange() or retrieve(), not when you actually subscribe.

Related: spring-cloud/spring-cloud-commons#579

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: backportAn issue that is a backport of another issue to a maintenance branchtype: enhancementA general enhancement

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions