PUBLISH

Syntax
PUBLISH channel message
Available since:
Redis Open Source 2.0.0
Time complexity:
O(N+M) where N is the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client).
ACL categories:
@pubsub, @fast,
Compatibility:
Redis Enterprise and Redis Cloud compatibility

Posts a message to the given channel.

In a Redis Cluster clients can publish to every node. The cluster makes sure that published messages are forwarded as needed, so clients can subscribe to any channel by connecting to any one of the nodes.

Redis Enterprise and Redis Cloud compatibility

Redis
Enterprise
Redis
Cloud
Notes
✅ Standard
✅ Active-Active
✅ Standard
✅ Active-Active

Return information

Integer reply: the number of clients that the message was sent to. Note that in a Redis Cluster, only clients that are connected to the same node as the publishing client are included in the count.
RATE THIS PAGE
Back to top ↑