Skip to content

Commit f558684

Browse files
committed
测试demo
1 parent 1440805 commit f558684

File tree

3 files changed

+55
-4
lines changed

3 files changed

+55
-4
lines changed

spring-cloud-gray-samples/spring-cloud-gray-service-a-sample/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
<version>3.5</version>
3636
</dependency>
3737

38+
39+
<dependency>
40+
<groupId>cn.springcloud.gray</groupId>
41+
<artifactId>spring-cloud-starter-gray-client</artifactId>
42+
</dependency>
3843
</dependencies>
3944

4045
<build>

spring-cloud-gray-samples/spring-cloud-gray-service-a-sample/src/main/resources/config/application.yml

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,58 @@ eureka:
1818
defaultZone: http://localhost:20001/eureka/
1919
# xuhui: http://localhost:20001/eureka/
2020
instance:
21-
instanceId: ${spring.cloud.client.ipAddress}:${spring.application.name}:${server.port}
21+
# instanceId: ${spring.cloud.client.ipAddress}:${spring.application.name}:${server.port}
2222
lease-renewal-interval-in-seconds: 10
2323
lease-expiration-duration-in-seconds: 30
24-
prefer-ip-address: true
24+
# prefer-ip-address: true
2525
metadata-map:
2626
version: v3
2727
# zone: gray3
2828
instanceId: s
2929
# initial-status: starting
30+
31+
32+
gray:
33+
mock:
34+
enabled: true
35+
36+
enabled: true
37+
hystrix:
38+
enabled: true
39+
server:
40+
url: http://gray-Server
41+
loadbalanced: true
42+
retryable: true
43+
retryNumberOfRetries: 3
44+
client:
45+
event:
46+
longpolling: 60000
47+
runenv: web
48+
infosUpdateIntervalTimerInMs: 0
49+
infosInitializeDelayTimeInMs: 10000
50+
instance:
51+
grayEnroll: false
52+
grayEnrollDealyTimeInMs: 20000
53+
holdoutServer:
54+
enabled: false
55+
services:
56+
"service-a": starting
57+
request:
58+
track:
59+
enabled: true
60+
trackType: web
61+
definitionsUpdateIntervalTimerInMs: 10000
62+
definitionsInitializeDelayTimeInMs: 10000
63+
web:
64+
track-definitions:
65+
- name: HttpReceive
66+
path-patterns: /*
67+
exclude-path-patterns: /test/*
68+
# client:
69+
# instance:
70+
# grayEnroll: false #是否在启动后自动注册成灰度实例
71+
logging:
72+
level:
73+
cn:
74+
springcloud:
75+
gray: debug

spring-cloud-gray-samples/spring-cloud-gray-service-b-sample/src/main/resources/config/application.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ eureka:
3939
availability-zones:
4040
sh: xuhui,gray
4141
serviceUrl:
42-
# defaultZone: http://localhost:20001/eureka/
42+
defaultZone: http://localhost:20001/eureka/
4343
xuhui: http://localhost:20001/eureka/
4444
gray: http://localhost:20001/eureka/
4545
registry-fetch-interval-seconds: 5
@@ -82,7 +82,7 @@ gray:
8282
holdout-server:
8383
enabled: true
8484
services:
85-
service-a: starting
85+
"service-a": starting
8686
request:
8787
track:
8888
enabled: true

0 commit comments

Comments
 (0)