Implementing worker microservices with ASP.NET core
In this section, we will show you how to implement a microservice that receives communications through gRPC and an internal queue based on a database table. The example is a part of the WWTravelClub book use case. The first subsection briefly describes the microservice specifications and the overall architecture.
The problem and the architecture
Our example microservice is required to compute the daily sums of all purchases. According to the data-driven approach, we suppose that all daily sums are pre-computed by receiving messages that are sent as soon as a new purchase is finalized. The purpose of the microservice is to maintain a database of all purchases and of all daily sums that can be queried by an administrative user. We will implement just the functionalities needed to fill the two database tables.
The implementation described in this section is based on an ASP.NET Core application that hosts a gRPC service....