RabbitMQ implements scheduled tasks to send SMS notifications

Business Process 

  1.  In the business module of the scheduled task, use the @Scheduled annotation to write a task that is executed regularly every day to send messages to the message queue. The main purpose is the notification function.
  2. Set up monitoring in the order module to call the notification service, query the order of the day to obtain user information, thereby notifying specific users, and finally call the send SMS module to send the specific SMS content.

To be optimized: messages may be lost and consumed repeatedly

Suggestion: You can use redis and mysql to cache messages, achieve message compensation, and solve idempotence.

Guess you like

Origin blog.csdn.net/qq_52183856/article/details/130933358