How it works...

The recipe above highlighted another Spring Cloud module that helps simplify the generation of client application, for microservices. A simple interface with a class-level annotation @FeignClient can generate results from RESTful endpoints.

On the other hand, this module has built-in loggers, encoders, and decoders which can process entity models to JSON objects. However, the current version of Feign has no support for asynchronous and reactive web services. Thus, adding and running the following services will give us decoding problems.

@RequestMapping(method = RequestMethod.GET, 
value = "/selectReactDepts" ) 
    public Flux<Department> getDepartments();   
   @RequestMapping(method = RequestMethod.GET, 
value = "/webSyncDeptList.json" ) 
  public WebAsyncTask<List<Department>> getAsyncListDepts(); 

Despite its limitations, Feign is widely used in interfacing many blocking web services because of its simplicity and robustness in generating client implementation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.166.31