我有这样的东西,
@FeignClient(name = "${airport.service.name}")
我有编译错误,例如
java.lang.IllegalStateException:服务 ID 不合法主机名 (${airport.service.name})
问题是我如何传递主机名形式applciation.yaml
到 FeignClient?
虽然已经很晚了,但我正在更新我的答案,因为我在 Spring Cloud 中使用 feign client 时遇到了这个异常(java.lang.IllegalStateException: Service id not legal hostname)
根本原因是假客户端不接受带下划线的服务名称,请浏览以下链接。为了解决这个问题,我将 feign 客户端使用的服务名称重命名为 hypen(school-service) 而不是 understore(school_service)
Github 链接 - spring-cloud-netflix - 问题 https://github.com/spring-cloud/spring-cloud-netflix/issues/1257
Github 链接 - spring-cloud-netflix - 提交 https://github.com/spring-cloud/spring-cloud-netflix/commit/b78242ce4f8c289a09f0b6b2821c5211e93a8921
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)