Which advantages brings Feign compared with JAX-RS Client, OkHttp, UniRest, Retrofit, Akka HTTP Client and another?
Well, a feign client will look like you are talking with a good api.
Also, you can easily mock.
In general, at work, we inject clients on constructors, so, when I'm unit testing my classes, I can easily use mockito to create the client.
One more thing, readability
interface GitHub {
@RequestLine("GET /repos/{owner}/{repo}/contributors")
List<Contributor> contributors(@Param("owner") String owner, @Param("repo") String repo);
}
much easier to read than
returnedEvents = client.target(baseUri)
.path("all")
.request(MediaType.APPLICATION_XML)
.get(new GenericType<List<Event>>() {
});
Would be great to see responses to become a PR to improve this section
https://github.com/OpenFeign/feign#why-feign-and-not-x
I agree with @velo on this and #955. Could we either update the area on the readme with more information or provide a Wiki page with this information? Would you @hellboy81 or any other member be interested in providing that information?
Most helpful comment
I agree with @velo on this and #955. Could we either update the area on the readme with more information or provide a Wiki page with this information? Would you @hellboy81 or any other member be interested in providing that information?