【发布时间】:2020-05-15 21:38:34
【问题描述】:
我们有多个服务,我们使用 feign 客户端进行通信(所有都是 Spring Boot 应用程序)。但是,我有一个场景,我们必须与外部服务进行通信。如果我通过url,它会起作用,但我想知道这是否是正确的做法。
@FeignClient(
name = "foo",
url = "${some.url.from.env}",
configuration = FeignConfiguration.class)
public interface FooClient {
@PostMapping("search/{searchQuery}")
ResponseEntity<JsonNode> getData(
@RequestBody POJO someObject);
感谢任何建议。
PS:对不起,如果我没有遵循 stackoverflow 规则(我的第一篇文章)。
【问题讨论】:
标签: java spring spring-boot service-discovery feign