Easy Tutorial
❮ Lists Blpop Lists Linsert ❯

Redis Publish Command

Redis Publish-Subscribe

The Redis Publish command is used to send a message to a specified channel.

Syntax

The basic syntax for the redis Publish command is as follows:

redis 127.0.0.1:6379> PUBLISH channel message

Available Versions

= 2.0.0

Return Value

The number of subscribers that received the message.

Example

redis 127.0.0.1:6379> PUBLISH mychannel "hello, I'm here"
(integer) 1

Redis Publish-Subscribe

❮ Lists Blpop Lists Linsert ❯