Skip to content

Conversation

@Arunodoy18
Copy link

…tion

The RestClientBeanPostProcessor was creating a new RestClient bean every time it processed a bean, even when the OpenTelemetry interceptor was already present. This resulted in unnecessary bean creation and caused issues with proxy/delegate RestClient beans.

Changes:

  • Modified RestClientBeanPostProcessor to track whether the interceptor was actually added during the mutation operation
  • Return the original bean instance if the interceptor is already present
  • Only create a new bean instance when the interceptor is actually added
  • Added test case to verify bean identity is preserved when interceptor exists

This fix ensures that:

  1. No unnecessary bean creation occurs when the interceptor is already present
  2. Proxy/delegate RestClient beans work correctly
  3. RestClient beans created with an injected RestClient.Builder that already has the interceptor configured are not unnecessarily mutated

Fixes the issue where RestClient beans with the OTel interceptor already configured would still trigger mutation and new bean creation.

…tion

The RestClientBeanPostProcessor was creating a new RestClient bean every time
it processed a bean, even when the OpenTelemetry interceptor was already present.
This resulted in unnecessary bean creation and caused issues with proxy/delegate
RestClient beans.

Changes:
- Modified RestClientBeanPostProcessor to track whether the interceptor was
  actually added during the mutation operation
- Return the original bean instance if the interceptor is already present
- Only create a new bean instance when the interceptor is actually added
- Added test case to verify bean identity is preserved when interceptor exists

This fix ensures that:
1. No unnecessary bean creation occurs when the interceptor is already present
2. Proxy/delegate RestClient beans work correctly
3. RestClient beans created with an injected RestClient.Builder that already
   has the interceptor configured are not unnecessarily mutated

Fixes the issue where RestClient beans with the OTel interceptor already
configured would still trigger mutation and new bean creation.
@Arunodoy18 Arunodoy18 requested a review from a team as a code owner December 6, 2025 17:28
@github-actions github-actions bot added the test native This label can be applied to PRs to trigger them to run native tests label Dec 6, 2025
@Arunodoy18
Copy link
Author

Please any reviewer to review this , and any more changes to be done regarding the issue just resolved.
Thank you.

@trask
Copy link
Member

trask commented Dec 6, 2025

Closing as there is already another PR for this: #15546

@trask trask closed this Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test native This label can be applied to PRs to trigger them to run native tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants