当前位置:网站首页>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边栏推荐
猜你喜欢

ZABBIX配置邮件报警和微信报警
创建&编译ROS软件包Package](/img/c2/5931d5cbade509c6ca34d66a274756.png)
[ROS](02)创建&编译ROS软件包Package

Mysql's case the when you how to use

浅浅写一下PPOCRLabel的使用及体验

跑跑yolov5吧

使用云GPU+pycharm训练模型实现后台跑程序、自动保存训练结果、服务器自动关机

云GPU(恒源云)训练的具体操作流程

Deep learning framework pytorch rapid development and actual combat chapter4

window10下半自动标注

Chapter6 visualization (don't want to see the version)
随机推荐
What's wrong with running yolov5 (1) p, r, map are all 0
Steps to connect the virtual machine with xshell_establish a network connection between the host and the vm virtual machine
St. Regis Takeaway Notes - Lecture 10 Swagger
Unit 15 Paging, Filtering
Haystack的介绍和使用
第六单元 初识ORM
Linux: CentOS 7 install MySQL5.7
redis延时队列
logback源码阅读(一)获取ILoggerFactory、Logger
What are the file encryption software?Keep your files safe
chapter6可视化(不想看版)
EasyExcel 的使用
鼠标右键菜单栏太长如何减少
Sentinel源码(六)ParamFlowSlot热点参数限流
chapter7
第七单元 ORM表关系及操作
[ROS](05)ROS通信 —— 节点,Nodes & Master
瑞吉外卖笔记——第10讲Swagger
[ROS]ROS常用工具介绍(待续)
Flask-RESTful request response and SQLAlchemy foundation