Redis也是拥有消息中间件的功能,但一般不是用redis来做消息中间件
1. 介绍
- 进程间的一种消息通信模式:发送者(pub)发送信息,订阅者(sub)接收信息
- 订阅 / 发布消息图


2. 命令
命令 | 描述 |
---|---|
psubcribe [pattem …] | 订阅一个或多个符合给定模式的频道 |
pubsub [subcommand] [argument …] | 查看订阅与发布系统状态 |
publish [channel] [message] | 将信息发送到指定的频道 |
punsubscribe [pattem …] | 退订所有给定模式的频道 |
subscribe [channel …] | 订阅给定的一个或多个频道的信息 |
unsubscrible [channel …] | 退订给定的频道 |
3. 案例

