Business process processing is asynchronous using MQ

Asynchronous, everything can be asynchronous.

Gu Qian, chief technical architect of Alibaba Cloud, said this when he came to the company to share last time, and I was particularly impressed by this sentence.

 

For example, the current process of placing an order can be handled asynchronously.

To place an order is to place an order, and not to do additional business that does not necessarily require 100% synchronous processing. After doing this, the api for placing an order is just to save the order, which will be very simple and stable. Other tasks, such as creating performance sheets, saving invoice data, generating promotional gifts, sending SMS verification codes for pickup, and processing delivery items And so on, you can use the MQ message consumer to receive the order message and then process it yourself.

 

Different APIs perform their own duties, and keep only doing their own core business work. After doing so, the maintenance will be very simple, and the version of the API will be very stable.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326316098&siteId=291194637