fiegnclient 无法识别 Spring Boot application.properties 文件中提到的 server.servlet.context-path

问题描述 投票:0回答:1

我正在使用 feign 客户端调用另一个微服务的 api,其中我提到了

server.servlet.context-path ="some value"
spring.application.name="app name"
,但是在 feign 客户端中使用它时,我没有获得带有上下文路径的完整 url。我应该如何提及
spring.application.name
以便它将给出服务的完整网址

spring spring-boot spring-cloud-feign
1个回答
0
投票

FeignClient注解有一个参数

path

/**
 * @return whether to mark the feign proxy as a primary bean. Defaults to true.
 */
boolean primary() default true;
© www.soinside.com 2019 - 2024. All rights reserved.