MicroService Container (Hereinafter “Container”) takes charge of creation, deletion, interface, monitoring, log on MicroService.
When the MicroService runs the Container, it follows below logic.
- It looks up Manager MicroService(Hereinafter “Manager”) from the route table.
- If not found, the Container becomes the Manager itself.
- If found, the Manager allocates task to the Container.
- According to granted task, the Container loads its MicroService.
- If a demanding MicroService module is installed, it is executed right away.
- If not, after downloading from module repository, it is executed.
init
function will be called from the created module.
The Container destroy the MicroService In the following situations.
- When the Container receives a
Kill
message from the Manager.- The container terminates the process when every incoming message is handled.
- For every incoming message after the
Kill
message, the Container returns404 error
to them.
Container is an interface between MicroServices.
- The MicroService sends messages to other MicroService through interface declared at the Container.
- The MicroService registers a Service Name and event handlers by the Container interface, it can receive messages through.
The Container monitors input, output, cpu and memory usage of the MicroService and it notifies the status if requested. When it comes to be decided to extend, the Container requests it to the Manager.
The Container sends the log data to log administrator of the MicroService.