System Overview - acken/outbox-workshop GitHub Wiki

All services in this system communicates through plain HTTP and json. All services registered in the discovery service exposes a heartbeat endpoint to detect whether it responds or not.

Discovery service

The discovery service is the first to start up. The way this sample is implemented it is purely in-memory so shutting down the discovery service will make the system forget everything. When starting up the discovery service it will sit and listen for services to register with it. Once a service registers the discovery service will call a heartbeat url for the service to make sure it responds and is alive. All services will contain a reference to the url of the discovery service to be able to get the location of other service types.

If a service goes down it will not be available for other services to be fetched from the discovery service. For instance the handler service will ask the discovery service to get the url for the service of type queue.

Any service can also report another service to the discovery service if it starts reporting errors and misbehaving. At this point the discovery service can remove the service from the environment to prevent others from using it.

SMS Gateway Service

The SMS Gateway service is the application endpoint. It contains a single HTTP POST route where any end user service can post temperature requests requests. This service will locate the queue service and hand the request over to the queue

Queue Service

The queue service will hold temperature requests that needs to be processed and also receive processed answers to be submitted to the phone number that requested the temperature information. The gateway can post requests messages while the handler service can pull messages from it. The handler service will also push answers to the answer queue when done.

Handler Service

The handler service is the one gathering all the information so that a reply can be made to the end user. It will first pick a message off of the queue, then go get the temperature from the given location and then pass the answer off to the answer queue on the queuing service.

Weather Service

The weather service has a single endpoint that will take a location and for now generate some random temperature and return it.