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
When creating an interface for retrofit and declaring a return type which is a parameterized class doesn't allow the application to start due to a ClassCastException in WebClientCallAdapterFactory#81 or, if not wrapping inside a Mono/Flux, WebClientCallAdapterFactory#87
The ReactorCallAdapterFactory used in com.jakewharton.retrofit:retrofit2-reactor-adapter allows such things, but then we lose the feature of a fully non-blocking client.
Also trying to use spring-cloud-square-retrofit + spring-cloud-square-okhttp does not work in webflux applications since a HttpMessageConverters bean is not created due to Conditional annotations.
Sample
Just create an application with spring webflux and an interface like the following:
@RetrofitClient(name ="whatever")
public interface MyClient {
@GET("/something")
Flux<MyType<MyObject>> getMyTypeWithMyObject();
}
Describe the bug
Using spring cloud square 0.4.1
When creating an interface for retrofit and declaring a return type which is a parameterized class doesn't allow the application to start due to a ClassCastException in
WebClientCallAdapterFactory#81or, if not wrapping inside a Mono/Flux,WebClientCallAdapterFactory#87The ReactorCallAdapterFactory used in
com.jakewharton.retrofit:retrofit2-reactor-adapterallows such things, but then we lose the feature of a fully non-blocking client.Also trying to use spring-cloud-square-retrofit + spring-cloud-square-okhttp does not work in webflux applications since a
HttpMessageConvertersbean is not created due to Conditional annotations.Sample
Just create an application with spring webflux and an interface like the following:
And include in your pom