The following code shows the existing configuration of RandomServiceProxy, which is used to call random service on Microservice A. The name attribute in the @FeignClient annotation is configured to use the application name of Microservice A. The request mapping uses the /random URI:
@FeignClient(name ="microservice-a") @RibbonClient(name="microservice-a") public interface RandomServiceProxy { @RequestMapping(value = "/random", method = RequestMethod.GET) public List<Integer> getRandomNumbers(); }
Now, we want the call to go through the API Gateway. We would need to use the application name of the API Gateway and the new URI of random service in the request mapping. The following snippet ...