Skip to content

RestClient : interceptors are executed 2 times #32196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rawadolb opened this issue Feb 5, 2024 · 1 comment
Closed

RestClient : interceptors are executed 2 times #32196

rawadolb opened this issue Feb 5, 2024 · 1 comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue type: bug A general bug

Comments

@rawadolb
Copy link

rawadolb commented Feb 5, 2024

Describe the bug
When RestCient is initialized by a RestTemplate using RestClient.builder(restTemplate) the interceptors are executed 2 times.

To Reproduce
Create a RestTemplate with an interceptor (loggingInterceptor to make it simple).
Initialize a RestClient and then perform a call restClient.get().uri(uri).retrieve().body(YourObject.class)
LoggingInterceptor will be executed 2 times because 2 ClientHttpRequestInterceptor object are created. (Please find attached)

Expected behavior
The interceptor must be executed once

image

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Feb 5, 2024
@jhoeller
Copy link
Contributor

jhoeller commented Feb 5, 2024

This should be fixed in 6.1.4 snapshots already: #32038

@jhoeller jhoeller closed this as completed Feb 5, 2024
@jhoeller jhoeller added status: duplicate A duplicate of another issue in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Feb 5, 2024
@sbrannen sbrannen closed this as not planned Won't fix, can't repro, duplicate, stale Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants