Closed akbarbd closed 2 years ago
Yes, you are right. But it works when debug the code, without debug it consume first consumer then change PersistMessage messageStatus.
Yes, you are right. But it works when debug the code, without debug it consume first consumer then change PersistMessage messageStatus.
I added a sample for RegisterNewUser endpoint
and after that publish an event user-created
and consume this event in multiple consumers (Flight-Services and Passenger-Services) and it's work correctly.
You can check these changes in this PR: #43
Here, I use masstransit and RabbitMQ for asynchronous communication. For each event, we can have multiple consumer and for each consumer we create a new queue. So each consumer subscribe to our queue and receive the event.
You can check this mechanism in code below: https://github.com/meysamhadeli/booking-microservices/blob/main/src/BuildingBlocks/MassTransit/Extensions.cs#L46