当前位置:网站首页>redis delay queue
redis delay queue
2022-08-02 14:21:00 【Spaghetti Mixed with No. 42 Concrete】
redis delay queue
Introduction
We are usually used to using Rabbitmq
and Kafka
as message queue middleware to add asynchronous messaging between applications.Both of these middleware are professional message queue middleware with more features than most people can understand.
Students who have used Rabbitmq
know how complicated it is to use. Before sending a message, you need to create a Exchange
, and then create a Queue
.Bind Queue
and Exchange
through a certain rule, specify routingkey
when sending a message, and control the header information.Consumers also need to go through the above series of cumbersome processes before consuming messages.But in most cases, although our message queue has only one set of consumers, it still needs to go through the above tedious processes.
With Redis, it can free us. For those message queues with only one set of consumers, Redis can be used very easily.The message queue of Redis is not a professional message queue. It does not have many advanced features, and there is no ack guarantee. If you have the ultimate pursuit of message reliability, then it is not suitable for use.
Asynchronous message queue
Redis's list (list) data structure is often used as an asynchronous message queue, using rpush/lpush operations to enter the queue, and use lpop and rpop to exit the queue.
127.0.0.1:6379> lpush notfily-queue apple banana pear(integer) 3127.0.0.1:6379>llen notfily-queue(integer) 3127.0.0.1:6379>lpop notfily-queue"apple"127.0.0.1:6379>llen notfily-queue(integer) 2127.0.0.1:6379>lpop notfily-queue"pear"127.0.0.1:6379>lpop notfily-queue"banana"127.0.0.1:6379>lpop notfily-queue(nil)127.0.0.1:6379>llen notfily-queue(integer) 0
边栏推荐
猜你喜欢
Unit 5 Hold Status
[ROS] Introduction to common tools in ROS (to be continued)
The 2nd China Rust Developers Conference (RustChinaConf 2021~2022) Online Conference Officially Opens Registration
[ROS] The difference between roscd and cd
window10下半自动标注
跑yolov5又出啥问题了(1)p,r,map全部为0
The bad policy has no long-term impact on the market, and the bull market will continue 2021-05-19
云GPU(恒源云)训练的具体操作流程
[ROS](03)CMakeLists.txt详解
[ROS](06)ROS通信 —— 话题(Topic)通信
随机推荐
瑞吉外卖笔记——第05讲Redis入门
第十一单元 序列化器
How does Apache, the world's largest open source foundation, work?
浅浅写一下PPOCRLabel的使用及体验
Flask框架深入一
Creating seven NiuYun Flask project complete and let cloud
编程规范——LiteOS
redis延时队列
Shell脚本完成pxe装机配置
xshell连接虚拟机步骤_建立主机与vm虚拟机的网络连接
drf源码分析与全局捕获异常
8576 顺序线性表的基本操作
【VCU】详解S19文件(S-record)
使用云GPU+pycharm训练模型实现后台跑程序、自动保存训练结果、服务器自动关机
Sentinel源码(二)入口方法分析
EasyExcel 的使用
The IDEA of packaged jar package
第七单元 ORM表关系及操作
跑跑yolov5吧
LayoutParams的详解