适配eureka

This commit is contained in:
tanghc
2019-09-27 20:06:52 +08:00
parent be0adc0a8e
commit 35253be77d
40 changed files with 751 additions and 294 deletions

View File

@@ -45,7 +45,7 @@
<!-- 使用nacos注册中心
版本 0.2.x.RELEASE 对应的是 Spring Boot 2.x 版本,版本 0.1.x.RELEASE 对应的是 Spring Boot 1.x 版本。
https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-alibaba-nacos-discovery
-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
@@ -56,8 +56,13 @@
<artifactId>nacos-client</artifactId>
<version>${nacos-client.version}</version>
</dependency>
-->
<!-- 注册中心end -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>

View File

@@ -1,8 +1,11 @@
server.port=3333
spring.application.name=book-service
# eureka注册中心
eureka.client.serviceUrl.defaultZone=http://localhost:1111/eureka/
# nacos注册中心
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
#spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
# consumer不需要检查provider是否启动
dubbo.consumer.check=false

View File

@@ -39,7 +39,7 @@
<!-- 使用nacos注册中心
版本 0.2.x.RELEASE 对应的是 Spring Boot 2.x 版本,版本 0.1.x.RELEASE 对应的是 Spring Boot 1.x 版本。
https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-alibaba-nacos-discovery
-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
@@ -50,8 +50,14 @@
<artifactId>nacos-client</artifactId>
<version>${nacos-client.version}</version>
</dependency>
-->
<!-- 注册中心end -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>

View File

@@ -1,8 +1,11 @@
server.port=2222
spring.application.name=story-service
# eureka注册中心
eureka.client.serviceUrl.defaultZone=http://localhost:1111/eureka/
# nacos注册中心
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
#spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
# dubbo配置
dubbo.protocol.name=dubbo