You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Spring Boot 3.0.0, ZipkinConfigurations.RestTemplateSenderConfiguration create a RestTemplate by relying on RestTemplateBuilder.
The contract indicates that providing a ZipkinRestTemplateBuilderCustomizer would allow for customization of the generated RestTemplate.
However, RestTemplateBuilder is immutable and each method returns a new instance (contrary to the WebClient version).
As a consequence, customization is impossible.
I think that it is required to make ZipkinRestTemplateBuilderCustomizer return a RestTemplateBuilder to have a working solution, or mutate the RestTemplate instead of the RestTemplateBuilder.
Work-around:
Define your own ZipkinRestTemplateSender (which requires duplicating a lot of classes since ZipkinRestTemplateSender is package private)
Use the web client version, which should not have this problem.
The text was updated successfully, but these errors were encountered:
I think we should change the signature of the customize method from void customize(RestTemplateBuilder restTemplateBuilder) to RestTemplateBuilder customize(RestTemplateBuilder restTemplateBuilder). While it is technically a breaking change, I think it's OK as the method's useless in its current form.
In Spring Boot 3.0.0,
ZipkinConfigurations.RestTemplateSenderConfiguration
create aRestTemplate
by relying onRestTemplateBuilder
.The contract indicates that providing a
ZipkinRestTemplateBuilderCustomizer
would allow for customization of the generatedRestTemplate
.However,
RestTemplateBuilder
is immutable and each method returns a new instance (contrary to the WebClient version).As a consequence, customization is impossible.
Example failing test:
I think that it is required to make
ZipkinRestTemplateBuilderCustomizer
return aRestTemplateBuilder
to have a working solution, or mutate the RestTemplate instead of the RestTemplateBuilder.Work-around:
ZipkinRestTemplateSender
(which requires duplicating a lot of classes since ZipkinRestTemplateSender is package private)The text was updated successfully, but these errors were encountered: