Publish-Subscribe (PubSub) is a classic messaging pattern which has a long history, as far back as 1987 according to Wikipedia. To explain it in simple terms, publishers, who want to publish the events, send messages to a PubSub channel, which delivers the events to each subscriber who has an interest in this channel. Many popular messaging middleware, like Kafka and ZeroMQ, take advantage of this pattern to build a message delivery system, and so does Redis. In this recipe, we'll explore the PubSub pattern of Redis.
Using PubSub
Getting ready…
You need to finish the installation of the Redis Server as we described in the Downloading and Installing Redis recipe in Chapter 1, Getting Started with Redis.
...