Publish a message

Publish a message to a Redis pub/sub channel

redis-cli PUBLISH events '{"type":"login","user":"alice"}'

tool
redis32 commands
tags
redis

More redis commands

  • redis-cli SUBSCRIBE events

    Subscribe to a channel and listen for messages

  • redis-cli INFO replication

    Show the role, connected replicas and replication lag

  • redis-cli BGSAVE && redis-cli LASTSAVE

    Start a background RDB save and print the last save time (it changes only when BGSAVE finishes)

  • redis-cli -n 1 FLUSHDB ASYNC

    Delete all keys in database 1 only, in the background

  • redis-cli ZREVRANGEBYSCORE leaderboard +inf -inf WITHSCORES LIMIT 0 10

    Show the top 10 entries of a sorted set with their scores

all 32 redis commands