1、@EnableEurekaClient 和 @EnableDiscoveryClient 的作用都是能夠讓注冊中心發現、並掃描到該服務
2、@EnableEurekaClient 只對 Eureka 注冊中心有效,而 @EnableDiscoveryClient 對 Eureka、Zookeeper、Consul 等注冊中心都有效
3、從 SpringCloud Edgware 版本開始, @EnableEurekaClient 和 @EnableDiscoveryClient 注解都可以省略了,只需要在 pom.xml 中引入依賴、在application.yml 上進行相關配置,就可以將微服務注冊到注冊中心上
4、但是為了起標識作用,最好還是加上 @EnableDiscoveryClient 注解