Skip to content
This repository has been archived by the owner on Mar 7, 2020. It is now read-only.

Decoder Support #10

Open
kdavisk6 opened this issue Aug 16, 2018 · 4 comments
Open

Decoder Support #10

kdavisk6 opened this issue Aug 16, 2018 · 4 comments
Labels

Comments

@kdavisk6
Copy link
Member

Add Decoder Support during the response phase.

@kptfh
Copy link
Collaborator

kptfh commented Aug 17, 2018

Do you mean feign.codec.Decoder ?

@kdavisk6
Copy link
Member Author

Yes.

@kptfh
Copy link
Collaborator

kptfh commented Aug 17, 2018

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.

@kdavisk6
Copy link
Member Author

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");

@velo velo added the API label Aug 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants