opentracing-contrib / java-spring-cloud

Distributed tracing for Spring Boot, Cloud and other Spring projects
Apache License 2.0
386 stars 142 forks source link

Feign clients created manually doesn't work with feign.Okhttp client #164

Open emersonborges opened 6 years ago

emersonborges commented 6 years ago

Feign clients created manually with Okhttp client doesn't work, I believe it's because Okhttp class is final and the AOP approach doesn't consider final classes. Should be ok to remove this final type validation from the aspect? Or is there another way to make this work with the Okhttp client?

pavolloffay commented 6 years ago

What do you mean by manually? Providing a feign.okhttp.OkHttpClient bean?

emersonborges commented 6 years ago

When I create a feign client with Feign builder:

Feign.builder()
    .client(new OkHttpClient())
    .target(FeignInterface.class, "http://localService");

OkHttpClient is a final class: https://github.com/OpenFeign/feign/blob/master/okhttp/src/main/java/feign/okhttp/OkHttpClient.java

pavolloffay commented 6 years ago

@emersonborges thanks, would you like to create a fix for this?