Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

SPUBLISH

Last updated
SPUBLISH shardchannel message
Group
Pub/Sub
Complexity
O(N) where N is the number of subscribers
Arity
3 (exactly, counting the command name)
Flags
pubsub, fast
Keys
first 1, last 1, step 1
HotKV Cloud
All plans
On-Premise
no license needed

SPUBLISH delivers message to every connection subscribed to the shard channel with SSUBSCRIBE. In a cluster the command is routed like a key to the shard that serves the channel’s slot, and the message reaches subscribers on that shard’s nodes only. Pattern subscriptions do not receive shard channel messages.

Case RESP2 RESP3
Always Integer: the number of subscribers on this node that received the message Integer
127.0.0.1:6379> SPUBLISH orders:{eu} "order 1001 placed"
(integer) 1

Same as Redis 7 and Valkey 8.

SSUBSCRIBE, PUBLISH, PUBSUB SHARDNUMSUB

In a cluster: Keys, slots and commands in a cluster