摘要:
1:注入 DiscoveryClient // import org.springframework.cloud.client.discovery.DiscoveryClient; @Autowired private DiscoveryClient discoveryClient; 2:对外提供方 阅读全文
摘要:
yml eureka: client: fetch-registry: true register-with-eureka: true service-url: defaultZone: http://eureka7002.com:7002/eureka/,http://eureka7001.com 阅读全文
摘要:
yml spring: application: name: cloud-payment-service # 也是注册到eureka服务的名称( 服务别名(使用服务别名去注册中心获取实际的RPC远程调用地址) ) 名字相同,则为注册的相同的服务,不同的实例(该名称不可随意改动,否则,client调用 阅读全文
摘要:
yml 消费端 eureka: client: fetch-registry: true register-with-eureka: true service-url: defaultZone: http://eureka7002.com:7002/eureka/,http://eureka7001 阅读全文
摘要:
分配端口 7001 7002 7003 yml eureka: instance: hostname: eureka7001.com #eureka服务端的实例名称 client: register-with-eureka: false #false表示不向注册中心注册自己 fetch-regist 阅读全文