I am a RabbitMQ
user exploring Redis
and have two questions regarding the pub/sub mechanism
Can I publish messages to the system where each client (consumer) removes the entry for other clients? I want to publish 100 tasks but each tasks should be processed only by 1-single subscriber.
AFAIK, by default all messages are always broadcasted/published to all clients. What if one client takes 1 second to process the message, and another takes a minute. What would be the limits here? Would be some messages dropped at some point?
Thanks a lot!
1) That's not how pub/sub works. Publish doesn't care or know about being received, it just publishes a message. Every subscriber that is subscribed will receive it and you can't stop this
2) That's up to you to handle client logic.
From the sounds of it, redis pub/sub might not be the system/pattern you're looking for. You should look into zeromq
especially, push
and pull
sockets, which instead of publishing messages, push messages to specific sockets one time. If you read through the starter documentation many patterns are explained and something will work for your specific case.
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