Design: Microservices Edge Case Handling
Focus on microservices communication patterns and fault tolerance. Out of scope: UI design, database internal optimizations.
Functional Requirements
Non-Functional Requirements
Jump into concepts and practice - no test required
Client
|
v
API Gateway
|
v
+-------------------+ +-------------------+
| Service Registry |<----->| Microservice A |
+-------------------+ +-------------------+
| |
v v
+--------------+ +--------------+
| Message Bus |<-------->| Microservice B|
+--------------+ +--------------+
|
v
+----------------+
| Saga Coordinator|
+----------------+attempts = 0
max_attempts = 3
while attempts < max_attempts:
response = call_service()
if response == 'success':
return 'done'
attempts += 1
return 'failed'
What will be the output if the service fails twice then succeeds on the third call?