A remote-service call can require handwritten request code. With OpenFeign, @FeignClient marks an interface as a client contract and tells OpenFeign to provide its implementation. Its name identifies the client, and its url sets the base URI; keeping that URI in an application property lets it vary by environment. section 11.3
A payments client
@FeignClient(name = "payments", url = "${name.service.url}") public interface PaymentsProxy { @PostMapping("/payment") Payment createPayment(@RequestHeader String requestId, @RequestBody Payment payment); } The interface method describes the REST call; OpenFeign supplies the implementation. section 11.3
Figure 11.5 With OpenFeign, you only need to define an interface (a contract) and tell OpenFeign where to find this contract to implement it. OpenFeign implements the interface and provides the implementation as a bean in the Spring context based on configurations you define with annotations. You can inject the bean from the Spring context anywhere you need it in your app.

See how OpenFeign turns the annotated interface into a Spring bean that can be injected where needed. section 11.3
