Using Redis as a message queue
In addition to being a super-fast data store, Redis also does message queuing! We just spent the previous chapter covering message queues, so we don't have to cover the reason as to why we should use them. We will only cover how Redis uses them.
Redis's message queuing is much simpler than RabbitMQ. RabbitMQ has many different types of exchanges, queues, protocols, and many other features that Redis does not try to match. Redis is super simple message sending. The method we are using here is publish/subscribe. Redis can also do simple message queuing like RabbitMQ, using RPOPLPUSH. Redis Pub/Sub broadcasts published messages with anyone that is currently subscribed. It does not actually queue the messages. This is ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access