-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapplication.yaml
More file actions
241 lines (216 loc) · 6.41 KB
/
application.yaml
File metadata and controls
241 lines (216 loc) · 6.41 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
spring:
application:
name: quizzes
profiles:
active: "@activatedProperties@"
group:
stream: remote
grpc: remote
datasource:
url: jdbc:postgresql://localhost:5432/msdb
driver-class-name: org.postgresql.Driver
username: postgres
password: postgres
jpa:
properties:
jakarta.persistence.sharedCache.mode: UNSPECIFIED
generate-ddl: true
hibernate:
ddl-auto: create # IMPORTANT this is only for jmeter testing -> it cleans the database every time it runs
show-sql: false
open-in-view: false
management:
endpoints:
web:
exposure:
include: "health,beans"
command:
gateway:
timeout-seconds: 10
resilience4j:
retry:
instances:
commandGateway:
max-attempts: 5
wait-duration: 500ms
enable-exponential-backoff: true
exponential-backoff-multiplier: 2
enable-randomized-wait: true
randomized-wait-factor: 0.5
retry-exceptions:
- java.lang.RuntimeException
ignore-exceptions:
- pt.ulisboa.tecnico.socialsoftware.ms.exception.SimulatorException
eureka:
client:
enabled: false
# Local-specific health tuning
---
spring:
config:
activate:
on-profile: local
management:
health:
rabbit:
enabled: false
# Tech-agnostic remote configuration
---
spring:
config:
activate:
on-profile: remote
rabbitmq:
host: ${SPRING_RABBITMQ_HOST:localhost}
port: 5672
username: guest
password: guest
cloud:
stream:
default:
contentType: application/json
bindings:
# --- Single Event channel (all events go through here) ---
event-channel:
destination: event-channel
# --- Event Subscribers (common to all remote modes) ---
questionEventSubscriber-in-0:
destination: event-channel
group: question-service-group
tournamentEventSubscriber-in-0:
destination: event-channel
group: tournament-service-group
executionEventSubscriber-in-0:
destination: event-channel
group: execution-service-group
answerEventSubscriber-in-0:
destination: event-channel
group: answer-service-group
quizEventSubscriber-in-0:
destination: event-channel
group: quiz-service-group
courseEventSubscriber-in-0:
destination: event-channel
group: course-service-group
topicEventSubscriber-in-0:
destination: event-channel
group: topic-service-group
userEventSubscriber-in-0:
destination: event-channel
group: user-service-group
eureka:
client:
enabled: true
service-url:
defaultZone: http://${EUREKA_HOST:localhost}:8761/eureka/
register-with-eureka: true
fetch-registry: true
registry-fetch-interval-seconds: 5
instance:
prefer-ip-address: true
instance-id: ${spring.application.name}:${random.uuid}
metadata-map:
grpcPort: ${grpc.server.port:9090}
quizzes:
function-definition:
events: >-
questionEventSubscriber;
tournamentEventSubscriber;
executionEventSubscriber;
answerEventSubscriber;
quizEventSubscriber;
courseEventSubscriber;
topicEventSubscriber;
userEventSubscriber
# Spring Cloud Stream specific (commands via RabbitMQ)
---
spring:
config:
activate:
on-profile: stream
cloud:
function:
definition: >-
${quizzes.function-definition.events};
commandResponseChannel;
answerServiceCommandChannel;
executionServiceCommandChannel;
questionServiceCommandChannel;
quizServiceCommandChannel;
topicServiceCommandChannel;
tournamentServiceCommandChannel;
userServiceCommandChannel;
courseServiceCommandChannel;
stream:
bindings:
# --- Command producers (outputs) ---
quiz-command-channel:
destination: quiz-command-channel
topic-command-channel:
destination: topic-command-channel
user-command-channel:
destination: user-command-channel
answer-command-channel:
destination: answer-command-channel
execution-command-channel:
destination: execution-command-channel
question-command-channel:
destination: question-command-channel
tournament-command-channel:
destination: tournament-command-channel
course-command-channel:
destination: course-command-channel
# --- Command consumers (inputs) ---
quizServiceCommandChannel-in-0:
destination: quiz-command-channel
group: quiz-service-group
topicServiceCommandChannel-in-0:
destination: topic-command-channel
group: topic-service-group
userServiceCommandChannel-in-0:
destination: user-command-channel
group: user-service-group
answerServiceCommandChannel-in-0:
destination: answer-command-channel
group: answer-service-group
executionServiceCommandChannel-in-0:
destination: execution-command-channel
group: execution-service-group
questionServiceCommandChannel-in-0:
destination: question-command-channel
group: question-service-group
tournamentServiceCommandChannel-in-0:
destination: tournament-command-channel
group: tournament-service-group
courseServiceCommandChannel-in-0:
destination: course-command-channel
group: course-service-group
# --- Response channel ---
commandResponseChannel-in-0:
destination: ${spring.application.name}-command-responses
group: response-group
# gRPC specific (commands via gRPC)
---
spring:
config:
activate:
on-profile: grpc
cloud:
function:
definition: ${quizzes.function-definition.events}
grpc:
server:
port: 9090
fallback-service: ${spring.application.name}
command:
default-port: 9090
version:
port: 9091
# Kubernetes specific
---
spring:
config:
activate:
on-profile: kubernetes
import:
- "classpath:application-kubernetes.yaml"