Redis – PubSub Publish Command

  • Post author:
  • Post category:Redis
  • Post comments:0 Comments

Redis PUBLISH command posts a message to a channel.

Syntax

Following is the basic syntax of Redis PUBLISH command.

redis 127.0.0.1:6379> PUBLISH channel message

Return Value

Integer reply − the number of clients that received the message.

Example

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

Leave a Reply