JHipster AuthorizedFeignClient动态名称

时间:2018-10-09 00:27:52

标签: java spring-boot microservices jhipster spring-cloud-feign

我正在寻找一种将动态名称与@AuthorizedFeignClient批注一起使用的方法。我有多个相同微服务的实例-每个实例都有不同的名称,并且我需要一种方法来指定要联系的微服务。

这是我的微服务客户端:

@AuthorizedFeignClient(name = "some changing name")
public interface MyClient {
    @RequestMapping(path = "/api/resource", method = RequestMethod.GET)
    String getResoruce();
}

我需要一种方法来指定要联系的实例

@Autowired
protected MyClient myClient;

// somehow need to specify which microservice to call
// based on the name passed in
foo(String name) {
    myClient.getResources()
}

0 个答案:

没有答案
相关问题