@RestController public class RoutesController { @Autowired private OAuth2RestTemplate restTemplate; @RequestMapping(value = "/routes") @Qualifier("userInfoRestTemplate") public ResponseEntity<String> getRoutes() { return restTemplate.getForEntity("http://zuul-server/routes", String.class); } }
转载于:https://my.oschina.net/u/2266730/blog/804740