Skip to content
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

Tracing Only Works for @LoadBalanced OkHttpClient.Builder Beans #55

Open
rsteppac opened this issue Nov 7, 2022 · 0 comments
Open

Tracing Only Works for @LoadBalanced OkHttpClient.Builder Beans #55

rsteppac opened this issue Nov 7, 2022 · 0 comments

Comments

@rsteppac
Copy link

rsteppac commented Nov 7, 2022

Describe the bug
spring-cloud-square-okhttp version 0.4.1

Auto-configuration of the org.springframework.cloud.square.okhttp.tracing.TracingOkHttpInterceptor only works if the client builder bean has been annotated with @LoadBalanced: OkHttpBuilderBeanPostProcessor.java#L42

Tracing and load balancing should work independently of each other.

Sample

@Configuration
class SampleContext {

    @Bean
    @LoadBalanced // Drop the annotation and tracing headers will no longer be added to the request
    fun okHttpClientBuilder() : OkHttpClient.Builder = OkHttpClient.Builder()

    @Bean
    fun okHttpClient(builder: OkHttpClient.Builder): OkHttpClient = builder.build()

}
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

No branches or pull requests

1 participant