今天发现微服务注册Eureka客户端,其实不需要添加@EnableEurekaClient注解
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
添加yml配置文件即可
eureka:
client:
register-with-eureka: true //注册到eureka客户端
fetch-registry: true //是否拉取其他的服务
service-url:
defaultZone:

本文揭示了在Spring Cloud中,无需使用@EnableEurekaClient注解,只需通过YAML配置文件管理微服务Eureka客户端的注册和拉取服务,简化开发流程。
1412

被折叠的 条评论
为什么被折叠?



