Microservices Wars
Blah blah intro - will get to this later.
Each service will have its own folder, with the folder name being the character the developer chooses. A project README.md file should be present in the service's folder, to describe the stack used, along with possible startup parameters and setup info.
Each of the attack endpoints (jab, cross, hook, uppercut) will also initiate requests to the relevant attack endpoints of the opponents, based on the combos section below.
Just returns "OK" and HTTP status code 200.
Will initiate a GET to the /status endpoint of the opponent - just to verify connectivity of the two opponents. Will also initiate a GET to the / endpoint of the referee - just to verify connectivity between itself and the referee.
Will start the combat, by sending a jab and hook request to the opponent.
Returns a newly generated UUID along with the result of FIB(2)
Returns a newly generated UUID along with the result of FIB(4)
Returns a newly generated UUID along with the result of FIB(8)
Returns a newly generated UUID along with the result of FIB(16)
Respond with jab, jab
Respond with jab, jab, cross
Respond with hook, hook, uppercut
Respond with cross, hook, uppercut
When an attack request is received (jab, cross, hook, uppercut), the service should do the following:
- Generate a new UUID
- Calculate (recursively) the relevant fibonacci number.
- Return both.
- Send relevant requests to opponent.
Meaning that first the response should be send back, before sending the attack requests to the opponent.
All responses should be JSON, just because.
Status response should be something like:
{ status: "ok" }
Combat responses (jab, cross, hook, uppercut) should be:
{
uuid: "08f5bbc2-4a6a-45fb-9c98-05068ba6560d",
fib: 5
}
Test and combat should just be empty responses with 200 http code (unless there is something wrong).
A strict timeout of 4s will be imposed; if a service's request is not served within 4s, the requesting process should exit, logging at the same time that they are the winner. E.g.
- service A sends a jab to Service B
- service A does not receive a response within 4s
- service A sends a won message to the referee
The winning message will have the format:
{
name: "service name",
date: timestamp
}