-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathapplication.yml
More file actions
195 lines (186 loc) · 6.82 KB
/
Copy pathapplication.yml
File metadata and controls
195 lines (186 loc) · 6.82 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
spring:
application:
name: customer360
jackson:
default-property-inclusion: non_null
serialization:
write-dates-as-timestamps: false
# --- Postgres / JPA ----------------------------------------------------
# The app persists tags, notes, and an audit log locally. In a RISE/BTP
# landscape this would be a hyperscaler-hosted Postgres or SAP HANA Cloud;
# for the demo we use stock Postgres, which Keploy's OSS core can record
# and replay at the wire-protocol level.
datasource:
# Default to IPv4 (127.0.0.1) + sslmode=disable so Keploy's eBPF proxy
# can capture the Postgres wire protocol cleanly on the host. The
# `localhost` hostname resolves to ::1 on most modern Linux stacks, and
# the eBPF hooks currently attach only to the v4 path; additionally
# the default postgres driver opts in to SSL negotiation, which fails
# with EOF mid-handshake under the proxy. Compose and k8s override this
# via SPRING_DATASOURCE_URL (hostname: postgres) where those concerns
# don't apply.
url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://127.0.0.1:5432/customer360?sslmode=disable}
username: ${SPRING_DATASOURCE_USERNAME:customer360}
password: ${SPRING_DATASOURCE_PASSWORD:customer360}
hikari:
maximum-pool-size: 10
minimum-idle: 2
connection-timeout: 10000
pool-name: customer360-hikari
jpa:
hibernate:
ddl-auto: validate
open-in-view: false
properties:
hibernate:
jdbc:
time_zone: UTC
format_sql: false
flyway:
enabled: true
baseline-on-migrate: true
locations: classpath:db/migration
# --- Cache -----------------------------------------------------------
# Caffeine-backed caches for SAP master data. Typical BTP-extension
# caching TTL is 30s-5min; we use 60s for demo visibility. Keploy
# records only the first-uncached call per (method, argument) — exactly
# what happens in production traffic.
cache:
type: caffeine
cache-names:
- sap.partner
- sap.partners-page
- sap.addresses
- sap.roles
- sap.count
caffeine:
spec: maximumSize=5000,expireAfterWrite=60s
server:
port: ${SERVER_PORT:8080}
# Graceful shutdown gives in-flight requests a chance to finish during
# rolling deploys on Kubernetes.
shutdown: graceful
forward-headers-strategy: native
compression:
enabled: false
http2:
enabled: true
tomcat:
mbeanregistry:
enabled: true
# ----------------------------------------------------------------------------
# SAP upstream configuration
# ----------------------------------------------------------------------------
sap:
api:
# Defaults to the public SAP Business Accelerator Hub sandbox; override
# for a real tenant by setting SAP_API_BASE_URL (and providing a bearer
# token or API key for that tenant).
base-url: ${SAP_API_BASE_URL:https://sandbox.api.sap.com/s4hanacloud}
key: ${SAP_API_KEY:}
bearer-token: ${SAP_BEARER_TOKEN:}
# Timeouts are sized for the SAP Business Accelerator Hub sandbox when
# routed through Keploy's eBPF proxy; first-hit latency on cold cache
# + TLS MITM occasionally reaches ~20s for a single OData GET, so we
# allow generous budgets rather than 502 a demo for a transient stall.
connect-timeout-seconds: ${SAP_CONNECT_TIMEOUT_SECONDS:15}
read-timeout-seconds: ${SAP_READ_TIMEOUT_SECONDS:45}
default-top: 10
customer360:
# Upper bound for the parallel fan-out (addresses/roles/tags/notes). The
# mandatory partner call runs before this and is bounded separately by
# sap.api.read-timeout-seconds × retry attempts. Kept larger than
# read-timeout so a single slow-but-eventually-successful SAP response
# still lands inside the captured window rather than degrading the view.
aggregate-timeout-seconds: ${CUSTOMER360_AGGREGATE_TIMEOUT_SECONDS:50}
# ----------------------------------------------------------------------------
# Resilience4j: retry + circuit breaker for SAP upstream calls
# ----------------------------------------------------------------------------
resilience4j:
retry:
instances:
sapApi:
max-attempts: 3
wait-duration: 500ms
enable-exponential-backoff: true
exponential-backoff-multiplier: 2
retry-exceptions:
- org.springframework.web.client.ResourceAccessException
- java.net.SocketTimeoutException
ignore-exceptions:
- com.tricentisdemo.sap.customer360.sap.SapApiException
circuitbreaker:
instances:
sapApi:
register-health-indicator: true
sliding-window-type: COUNT_BASED
sliding-window-size: 20
minimum-number-of-calls: 10
failure-rate-threshold: 60
slow-call-rate-threshold: 70
slow-call-duration-threshold: 20s
permitted-number-of-calls-in-half-open-state: 3
wait-duration-in-open-state: 10s
automatic-transition-from-open-to-half-open-enabled: true
# ----------------------------------------------------------------------------
# Spring Boot Actuator — health, metrics, info
# /actuator/health is the Kubernetes liveness/readiness probe target.
# ----------------------------------------------------------------------------
management:
endpoints:
web:
exposure:
include: health, info, metrics, prometheus
base-path: /actuator
endpoint:
health:
probes:
enabled: true
show-details: when_authorized
show-components: always
group:
liveness:
include: livenessState
readiness:
include: readinessState, circuitBreakers
health:
circuitbreakers:
enabled: true
db:
enabled: true
info:
env:
enabled: true
metrics:
tags:
application: ${spring.application.name}
distribution:
percentiles-histogram:
http.server.requests: true
percentiles:
http.server.requests: 0.5, 0.95, 0.99
info:
app:
name: ${spring.application.name}
description: SAP Customer 360 aggregator — reference integration service
version: 1.0.0
# ----------------------------------------------------------------------------
# OpenAPI / Swagger UI
# ----------------------------------------------------------------------------
springdoc:
api-docs:
path: /v3/api-docs
swagger-ui:
path: /swagger-ui.html
operationsSorter: method
# ----------------------------------------------------------------------------
# Logging — levels only. The console/JSON patterns live in logback-spring.xml
# (which is the single source of truth; Boot's `logging.pattern.*` keys are
# ignored whenever logback-spring.xml is present, so duplicating them here
# invited drift).
# ----------------------------------------------------------------------------
logging:
level:
root: INFO
com.tricentisdemo.sap: INFO
org.springframework.web: INFO