Below command only gives channel list .
127.0.0.1:6379> PUBSUB CHANNELS
1) "mychannel"
2) "mychanne2"
How to LIST subscribers subscribed on channel1 OR channel2 .?
also
i din't found redis command to list all subscribers Of a particular channel
You can use PUBSUB NUMSUB channel1 OR PUBSUB NUMSUB channel2 and get reply about the number of subscribers for the specified channel.
Regarding the number of subscribers and publishers, it is limited by the maxclients setting, 10,000 by default. There is no limitation for subscribers and publishers, but the maximum clients (connections) limit applies.
Redis and PHP Redis Pub/Sub implements the messaging system where the senders (in redis terminology called publishers) sends the messages while the receivers (subscribers) receive them. The link by which the messages are transferred is called channel. In Redis, a client can subscribe any number of channels.
To start Redis client, open the terminal and type the command redis-cli. This will connect to your local server and now you can run any command. In the above example, we connect to Redis server running on the local machine and execute a command PING, that checks whether the server is running or not.
You can use PUBSUB NUMSUB channel1
OR PUBSUB NUMSUB channel2
and get reply about the number of subscribers for the specified channel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With