application.yml文件
application.yml文件中及其容易紊乱的两个配置
server:
port: 8100
spring:
application:
name: provider-product
eureka:
instance:
prefer-ip-address: true
appname: provider-product-instance
client:
fetch-registry: true
register-with-eureka: true
service-url:
defaultZone: http://127.0.0.1:7900/eureka/
spring.application.name 为远程调用接口所属的服务模块名
/*
* 调用商品的远程服务
* */
@Component
@FeignClient(name="provider-product")
public interface ProductService {
eureka.instance.appname = provider-product-instance的值如下图