Browse Source

配置

tags/正式3.2.0
王宁 2 years ago
parent
commit
d8e739686b

+ 1
- 1
gateway/pom.xml View File

@@ -20,7 +20,7 @@
20 20
     <dependencies>
21 21
         <dependency>
22 22
             <groupId>org.springframework.cloud</groupId>
23
-            <artifactId>spring-cloud-starter-circuitbreaker-resilience4j</artifactId>
23
+            <artifactId>spring-cloud-starter-circuitbreaker-reactor-resilience4j</artifactId>
24 24
         </dependency>
25 25
         <!--<dependency>
26 26
             <groupId>org.springframework.cloud</groupId>

+ 2
- 0
gateway/src/main/java/com/xhkjedu/gateway/GatewayApplication.java View File

@@ -2,8 +2,10 @@ package com.xhkjedu.gateway;
2 2
 
3 3
 import org.springframework.boot.SpringApplication;
4 4
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
5 6
 
6 7
 @SpringBootApplication
8
+@EnableEurekaClient
7 9
 public class GatewayApplication {
8 10
 
9 11
     public static void main(String[] args) {

+ 0
- 1
gateway/src/main/java/com/xhkjedu/gateway/config/CustomizeCircuitBreakerConfig.java View File

@@ -17,7 +17,6 @@ import java.time.Duration;
17 17
  * Date 2022/2/16 10:59
18 18
  **/
19 19
 @Configuration
20
-@EnableEurekaClient
21 20
 public class CustomizeCircuitBreakerConfig {
22 21
 
23 22
     @Bean

+ 2
- 2
gateway/src/main/resources/application.properties View File

@@ -5,9 +5,9 @@ spring.application.name=gateway
5 5
 spring.cloud.gateway.routes[0].id=path_sstudy
6 6
 spring.cloud.gateway.routes[0].uri=lb://sstudy
7 7
 spring.cloud.gateway.routes[0].predicates[0]=Path=/sstudy/**
8
-spring.cloud.gateway.routes[0].filters[0]=RewritePath=/sstudy/paper/(?<segment>.*), /sstudy/$\{segment}
8
+spring.cloud.gateway.routes[0].filters[0]=RewritePath=/sstudy/(?<segment>.*), /$\{segment}
9 9
 spring.cloud.gateway.routes[0].filters[1].name=CircuitBreaker
10 10
 spring.cloud.gateway.routes[0].filters[1].args.name=myCircuitBreaker
11 11
 spring.cloud.gateway.routes[0].filters[1].args.fallbackUri=forward:/fallback
12 12
 
13
-eureka.client.service-url.defaultZone=http://localhost:8081/eureka/
13
+eureka.client.service-url.defaultZone=http://127.0.0.1:8081/eureka/

+ 2
- 0
register/src/main/resources/application.properties View File

@@ -3,3 +3,5 @@ server.port=8081
3 3
 #禁止注册自己
4 4
 eureka.client.register-with-eureka=false
5 5
 eureka.client.fetch-registry=false
6
+
7
+eureka.client.service-url.defaultZone=http://127.0.0.1:8081/eureka/

+ 1
- 1
sapi/src/main/resources/application.properties View File

@@ -3,7 +3,7 @@ server.port=8088
3 3
 
4 4
 spring.application.name=sapi
5 5
 #注册到我们本地的eureka注册中心,端口8081
6
-eureka.client.service-url.defaultZone=http://localhost:8081/eureka/
6
+eureka.client.service-url.defaultZone=http://127.0.0.1:8081/eureka/
7 7
 
8 8
 spring.datasource.url=jdbc:mysql://dbtest.xhkjedu.com:13306/xhkjedu_school_test?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true&allowMultiQueries=true
9 9
 spring.datasource.username=root

+ 2
- 2
sclass/src/main/resources/application.properties View File

@@ -3,7 +3,7 @@ server.port=8085
3 3
 
4 4
 spring.application.name=sclass
5 5
 #注册到我们本地的eureka注册中心,端口8081
6
-eureka.client.service-url.defaultZone=http://localhost:8081/eureka/
6
+eureka.client.service-url.defaultZone=http://127.0.0.1:8081/eureka/
7 7
 
8 8
 spring.datasource.url=jdbc:mysql://dbtest.xhkjedu.com:13306/xhkjedu_school_test?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true&allowMultiQueries=true
9 9
 spring.datasource.username=root
@@ -56,4 +56,4 @@ secretKey=nanhuakaizhangjianwangni
56 56
 #每隔3s清除一下请求地址map
57 57
 cron.deleteUriMap=0/3 * * * * ?
58 58
 #默认为false,不开启定时任务
59
-enable.scheduled=false
59
+enable.scheduled=false

+ 1
- 1
slive/src/main/resources/application.properties View File

@@ -3,7 +3,7 @@ server.port=8086
3 3
 
4 4
 spring.application.name=slive
5 5
 #注册到我们本地的eureka注册中心,端口8081
6
-eureka.client.service-url.defaultZone=http://localhost:8081/eureka/
6
+eureka.client.service-url.defaultZone=http://127.0.0.1:8081/eureka/
7 7
 
8 8
 spring.datasource.url=jdbc:mysql://dbtest.xhkjedu.com:13306/xhkjedu_school_test?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true&allowMultiQueries=true
9 9
 spring.datasource.username=root

+ 1
- 1
sstudy/src/main/resources/application.properties View File

@@ -3,7 +3,7 @@ server.port=8087
3 3
 
4 4
 spring.application.name=sstudy
5 5
 #注册到我们本地的eureka注册中心,端口8081
6
-eureka.client.service-url.defaultZone=http://localhost:8081/eureka/
6
+eureka.client.service-url.defaultZone=http://127.0.0.1:8081/eureka/
7 7
 
8 8
 spring.datasource.url=jdbc:mysql://dbtest.xhkjedu.com:13306/xhkjedu_school_test?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true&allowMultiQueries=true
9 9
 spring.datasource.username=root

+ 1
- 1
suser/src/main/resources/application.properties View File

@@ -2,7 +2,7 @@ server.port=8084
2 2
 
3 3
 spring.application.name=suser
4 4
 #注册到我们本地的eureka注册中心,端口8081
5
-eureka.client.service-url.defaultZone=http://localhost:8081/eureka/
5
+eureka.client.service-url.defaultZone=http://127.0.0.1:8081/eureka/
6 6
 
7 7
 spring.datasource.url=jdbc:mysql://dbtest.xhkjedu.com:13306/xhkjedu_school_test?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true&allowMultiQueries=true
8 8
 spring.datasource.username=root

Loading…
Cancel
Save