Let’s say I have microservice “UserManagement” and microservice “UserReportService”.
UserManagement is a web API project which exposes public endpoints. It is used to manage user information.
UserReportService is a console application that gathers each user’s info each day and generates a report — JSON data and a file. It stores it in its own database. Since this is a console application there is no http endpoint for any other service to access this data.
If my UserManagement microservice needs to expose this data via an API, how can I accomplish this?
I’ve thought of two ways:
The console app saves the data to the UserManagement microservice instead of its own database via an http endpoint on the UserManagement microservice or via some kind of message queue.
The console app saves the data to its own database and the data is replicated to the UserManagement microservice for consumption.