- FeignClient标签默认使用name属性作为bean name,name属性同时为服务名。
- 如果指定了contextId属性,则使用contextId作为bean name。 如此可为一个服务创建多个FeignClient:
@FeignClient(name = "my-service-id", contextId = "my-service-id-api1")
public interface Api1FeignClient {
}
@FeignClient(name = "my-service-id", contextId = "my-service-id-api2")
public interface Api2FeignClient {
}