English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Redis Subscribe Command

Redis Pub/Sub

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

Syntax

Basic Syntax of Redis Subscribe Command:

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

Available Version

>= 2.0.0

Return Value

Received Information

Online Examples

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 Pub/Sub