![]() What happens if the OrderProcessing Microservice is offline? Absolutely nothing! The user would be notified something like “Tickets confirmed! Please wait for the confirmation mail”. Hence we push the order details to the Queue. Since this is a client facing, business oriented application, we should ensure that the Order always get stored in the memory and doesnt fail / get lost at any point of time. This defeats the purpose of having a Microservice architecture. So, why RabbitMQ in this scenario? Can’t we Directly POST to the OrderProcessing Microservice? No. These details will finally be stored to a database and the user will be notified by email of the order state. The ticket details would be sent to a RabbitMQ Queue, which would later be consumed by the OrderProcessing Microservice. Internally, this generates a POST request from the Ticket Microservice. The user buys a tickets via the front-end. We will have 2 Microservices with RabbitMQ connection for communication. Let’s mimic a ticketing application where the user can book his/her ticket. Even if all the consumers are offline, the messages are still in RabbitMQ waiting for the consumers to come online and take the message off their particular queues. This does not in any way affect the integrity of the system. Here consumer #3 is offline for a specific time. Here is a simple demonstration of work-flow in a basic RabbitMQ setup. Once the Service comes online, it consumes the pending messages and processes it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |