Masstransit sagas current state1/14/2024 ![]() The state machine responds, sends a CookDish command, waits for a message from the DishCookedConsumer and sends a DeliverOrder command to deliver the order. After the manager approves the order with a request, the controller sends an AcceptOrder command. At this point, the state machine pauses and waits for action from the user. The corresponding OrderPlacedConsumer responds to this event and sends a notification to the manager about the new order. The state machine receives the command, sets itself to Placed status and sends the OrderPlaced event. The controller transforms this request into a PlaceOrder command and sends it to the message bus. The user sends a request to create an order. Įventually, modify controllers to send corresponding commands and register state machine in the Startup class. Let’s start with an empty ASP.NET template. The courier delivers food to the user’s address.The kitchen gets the order details and cooks it.The manager receives a notification about the new order and accepts (or denies) it.A user places online order from the website.The whole process will be consists of four steps: As you may notice, food delivery is popular nowadays, so we want to implement this functionality in the app. Let’s pretend we’re developing an application for the restaurant. If you want to look at the project yourself, I left a link to GitHub at the end of the post. Within this system, we’ll try to connect different parts with orchestration pattern. So, today we’ll take a look at the straightforward application for food delivery. The previous post was about two main patterns for coordinating services in a distributed system.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |