Get the App
SLTechnology News&Howtos  ›  Database  › 

Application decoupling of queue message in redis

Shulou Source: shulou.com Published: 2022-05-31 22:05:17 10月27日 Update

What this article shares to you is about the application decoupling of the queue message in redis. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

1. What if the redis server hangs up?

Make a judgment in the signing logic code of the purchasing module, return the signing completion if the listing is successful, and run the traditional method through the interface if the listing fails. What if the redis is dead and the warehouse module is also dead? pack your bags and go home.

2. How to store it in real time in the traditional way?

It can be solved by using redis's subscription and publishing model. The subscription code is placed in the warehouse module, and the published code is placed in the procurement module.

Subscription code sub.php

Tags: Code modules subscriptions queues messages decoupling applications warehouses traditions what to do methods more knowledge articles channels procurement utility success information baggage Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS vpn Redmi Shulou Tech Info MariaDB