-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin-service.yml
78 lines (66 loc) · 1.71 KB
/
admin-service.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
spring:
#rabbitmq的配置
rabbitmq:
host: 192.168.145.101
port: 5672
username: guest
password: guest
virtual-host: /
#配置zipkin
zipkin:
base-url: http://192.168.145.101:9411/
#配置采样百分比
sleuth:
sampler:
probability: 1
server:
port: 9100
feign:
#开启Feign对Hystrix的支持
hystrix:
enabled: true
#设置调用超时时间
client:
config:
default:
connectTimeout: 2000
readTimeout: 2000
#hystrix的熔断机制
hystrix:
command:
#default全局有效,service id 指定应用有效
default:
execution:
timeout:
#如果enabled设置为false(禁用hystrix),则请求超时交给ribbon控制,为true,则超时作为熔断根据
enabled: true
isolation:
thread:
#断路器超时时间,默认1000ms
timeoutInMilliseconds: 6000
#开启actuator监控端点(暴露全部监控信息)
management:
endpoints:
web:
exposure:
include: "*"
base-path: /
#自定义负载均衡策略
user-service:
ribbon:
NFLoadBalancerRuleClassName: com.netflix.loadbalancer.RandomRule
# 使用Feign调用接口分两层,ribbon的调用和hystrix的调用,所以ribbon的超时时间和Hystrix的超时时间的结合就是Feign的超时时间
# 一般情况下 都是 ribbon 的超时时间(<)hystrix的超时时间(因为涉及到ribbon的重试机制)
# hystrix:
# command:
# default:
# execution:
# timeout:
# enabled: true
# isolation:
# thread:
# timeoutInMilliseconds: 9000
# #ribbon的超时时间
# ribbon:
# ReadTimeout: 3000
# ConnectTimeout: 3000