Easy Tutorial
❮ Sets Sdiffstore Redis Keys ❯

Redis Subscribe Command

Redis Publish Subscribe

The Redis Subscribe command is used to subscribe to information from one or multiple given channels.

Syntax

The basic syntax for the Redis Subscribe command is as follows:

redis 127.0.0.1:6379> SUBSCRIBE channel [channel ...]

Available Versions

= 2.0.0

Return Value

Received messages

Example

redis 127.0.0.1:6379> SUBSCRIBE mychannel 
Reading messages... (press Ctrl-C to quit)
1) "subscribe"
2) "mychannel"
3) (integer) 1
1) "message"
2) "mychannel"
3) "a"

Redis Publish Subscribe

❮ Sets Sdiffstore Redis Keys ❯