feign-reactive
feign-reactive copied to clipboard
Decoder Support
Add Decoder Support during the response phase.
Do you mean feign.codec.Decoder ?
Yes.
feign.codec.Decoder doesn't meant for reactive decoding.
I suggest that exact implementation of ReactiveHttpClient should implement encoding/decoding.
In case of implementation based on Spring WebClient I don't need encoding/decoding as Spring takes full responsibility.
I agree, in this case, it should be the responsibility of a ReactiveHttpClient to support both encoding and decoding, as that's ideally where it would occur. SpringWebFlux is a high level construct, and is similar to OpenFeign's Client, and is implicitly performing the encoding and decoding for you.
With that said, this library should be able to allow for more than just a SpringWebFlux implementation. In order to do so, I am suggesting that we attempt to support the OpenFeign Encoder, Decoder, and Client constructs. For example, I think it would be great if this library could support using Reactor based constructs, with a Jackson encoder and decoder.
interface GitHub {
@RequestLine("GET /repos/{owner}/{repo}/contributors")
Flux<Contributor> getContributors(@Param("owner") String owner, @Param("repo") String repository);
}
GitHub gitHub = ReactiveFeign.builder()
.encoder(new JacksonEncoder())
.decoder(new JacksonDecoder())
.client(new ApacheHttpClient()) // wraps in a ReactiveHttpClient
.target(GitHub.class, "https://www.github.com");