-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi-gateway-service.yml
101 lines (92 loc) · 2.41 KB
/
api-gateway-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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
eureka:
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://localhost:8070/eureka/
server:
port: 9000
shutdown: graceful
spring:
lifecycle:
timeout-per-shutdown-phase: 15s
cloud:
gateway:
httpclient:
connect-timeout: 2000 # 2s
response-timeout: 5s
pool:
type: elastic
max-idle-time: 15s
max-life-time: 60s
default-filters:
# - SaveSession
# - TokenRelay
# - name: RequestRateLimiter
# args:
# redis-rate-limiter.replenishRate: 10
# redis-rate-limiter.burstCapacity: 20
# redis-rate-limiter.requestedTokens: 1
- name: Retry
args:
retries: 3
methods: GET
series: SERVER_ERROR
exceptions: java.io.IOException, java.util.concurrent.TimeoutException
backoff:
firstBackoff: 50ms
maxBackOff: 500ms
factor: 2
basedOnPreviousValue: false
routes:
- id: catalog-route
uri: lb://CATALOG-SERVICE
predicates:
- Path=/api/v1/products/**
filters:
- name: CircuitBreaker
args:
name: catalogCircuitBreaker
fallbackUri: forward:/catalog-fallback
- id: order-route
uri: lb://ORDER-SERVICE
predicates:
- Path=/api/v1/orders/**
filters:
- name: CircuitBreaker
args:
name: orderCircuitBreaker
fallbackUri: forward:/catalog-fallback
# redis:
# connect-timeout: 2s
# host: localhost
# port: 6379
# timeout: 1s
# session:
# store-type: redis
# timeout: 10m
# redis:
# namespace: myapp:edge
security:
oauth2:
client:
registration:
keycloak:
client-id: api-gateway-service
client-secret: ecomm-keycloak-secret
scope: openid,roles
provider:
keycloak:
issuer-uri: http://localhost:8080/realms/Ecommshop
resilience4j:
circuitbreaker:
configs:
default:
slidingWindowSize: 20
permittedNumberOfCallsInHalfOpenState: 5
failureRateThreshold: 50
waitDurationInOpenState: 15
timelimiter:
configs:
default:
timeoutDuration: 5s