springboot启动feign项目报错:Service id not legal hostname

正经学徒,佛系记录,不搞事情

feign项目中,定义接口调用服务

@FeignClient(name= "eureka_client")
public interface TestInterface {
    @GetMapping(value = "/get")
    String get();
}

启动时报出异常信息:

 度娘后发现问题所在:

feign不支持"_",改成"-"即可

name= "eureka-client"

配置文件服务名做同样修改:

spring.application.name=eureka-client

参考:https://github.com/spring-cloud/spring-cloud-netflix/issues/1582

猜你喜欢

转载自blog.csdn.net/qq_31748587/article/details/86006793