I am planing to use Microservice architecture for a project. The selected technology stack is .NET Core
with Docker
and RabbitMQ
as a simple service bus and this should be able to deploy on Linux
.
Lets say I have a Payment
service and an Order
Service, I want each of these services to expose REST
endpoints. Because of that, I thought of making these two services as .NET Core Web APIs
.
But the problem is the inter-service communication using RabbitMQ
. Whenever I get a new order
, I want to publish an event using RabbitMQ
and then listen to that event in Payment
service to perform certain operations (database updates). But since these are Web APIs
, I don't think it's possible to listen to events as I described. (I feel like I might have to use something like a console application to subscribe to events.)
I would like to find the most viable method to achieve this using the best practices considering the scalability and extendability of the system.