For a long time we were using msmq and redis queue (IRedisList
).
Couple of month ago we started trying redis pub-sub .
Our application has more than twenty services that read messages from queue or subscribe to channels with redis . We also have more than ten queues that we send messages to them. The application is multi-threaded.
So what do i want from you?
Now we have some time to spend on deciding what kind of the queues above do we want to use and what do we want to replace with a different kind of queue.
I tried to look for post about MSMQ VS Redis and did not find enough information.
Can someone advise me about this issue?
Redis Pub/Sub is an extremely lightweight messaging protocol designed for broadcasting live notifications within a system. It's ideal for propagating short-lived messages when low latency and huge throughput are critical. Redis Lists and Redis Sorted Sets are the basis for implementing message queues.
Using Redis with Redis Queue allows you to enter those complex tasks into a queue, so the Redis worker executes these tasks outside of your application's HTTP server. In this article, we will build an app that enqueues jobs with Redis queue, performs a function on those jobs and returns the result of the function.
At its core, Redis is an in-memory data store that can be used as either a high-performance key-value store or as a message broker.
One feature of Redis is that a task cannot leave the control of Redis until it has completed. So in this case, Redis transfers the task into another Queue, let's call it the 'work' or 'processing' queue. Each task will be deferred to this work queue before being given to the application.
IMO, you are trying to compare apples and oranges here.
MSMQ is an enterprise-class MOM (message oriented middleware, i.e. a queuing system) offering persistency, transactional support, and a rich set of features.
Redis is a fast in-memory data structure server, on which you can build a queuing system. A proper implementation of the basic features of MSMQ with Redis is already a difficult task. It would probably not be possible at all to implement the advanced features (like the distribution transaction support).
I would suggest to try to list the properties you expect from the queuing system:
Depending on your requirements Redis may or may not be a good fit. But do not expect to get the bells and whistles of a real MOM with Redis.
Last point: you mentioned the Redis pub/sub feature. Please note this mechanism is not at all based on a queuing system. There is no guarantee about the delivery of messages with Redis pub/sub. If a subscriber does not listen, the item will be lost for this subscriber.
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