Redis: Publish Subscribe Cheat Sheet

Psubscribe Command

redis 127.0.0.1:6379> PSUBSCRIBE CHANNEL_NAME_OR_PATTERN [PATTERN...]

Pubsub Command

redis 127.0.0.1:6379> PUBSUB subcommand [argument [argument ...]]

Publish Command

redis 127.0.0.1:6379> PUBLISH channel message

Punsubscribe Command

redis 127.0.0.1:6379> PUNSUBSCRIBE [pattern [pattern ...]] 

PubSub Subscribe Command

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

Unsubscribe Command

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

Leave a Reply

Your email address will not be published. Required fields are marked *