Projects - NielsB95/APIGateway GitHub Wiki
This page will describe the projects in the solution. Every project has its own purpose, which will help make this application loosely coupled.
APIGateway
This is the main project of the solution. This part will make sure that all other components are initialized correctly. The most important feature is that it is the bootable part of the application.
APIGateway.Authentication [TODO]
This part of the application will verify if the request can be passed through or should be rejected. The authentication and authorization won't be done in this application. Instead, the gateway will ask the Authentication service
how to judge these credentials. To improve the performance and passthrough speed same caching might be applied.
APIGateway.Health [TODO]
In APIGateway.Health
we will learn the APIGateway to do health checks on each microservice. This part of the application will notify us when one of the microservices isn't working or isn't responding fast enough anymore.
APIGateway.Services
In APIGateway.Services
we keep track of the available services that we can forward requests to. Other services will be able to register themselves by signing up. Other services need to specify on what endpoints they are available.
APIGateway.Logging
This part of the application is responsible for logging the incoming requests. The logging has been implemented by adding a middleware layer to the request processing pipeline.
APIGateway.Queue
The APIGateway.Queue
is responsible for processing all the incoming requests. Like logging, this has been implemented using middleware. A request is placed in the RequestQueue
when it enters the application. Meanwhile, there are a configurable amount of workers processing the requests on the queue. These workers are constantly busy trying to empty the queue. When processing a request a worker looks for a matching endpoint on one of the registered microservices. If it couldn't find a matching service it will look for a matching endpoint on the APIGateway
. When this also doesn't result in a matching endpoint, a 404 not found status is returned.