Redis键空间通知,实现延迟消息队列,归还订单库存
1、开启Redis的 notify-keyspace-events 功能redis.conf配置文件中,添加notify-keyspace-events Ex;E是键空间通知, x代表过期事件。需要重启redis用redis-cli测试1.订阅0号数据库的过期事件127.0.0.1:6379> psubscribe __keyevent@0__:expiredReading messages... (press Ctrl-C to quit)1) "psubscribe"2) "__k
原创
2020-07-31 16:18:26 ·
370 阅读 ·
0 评论