Commonly used rabbitmq, activeMq queues, multiple consumers or multiple threads to get the data in the queue, will it happen that different consumers arrive at the same time to get the same data? At present, we only know that since redis is single-threaded, this situation can be avoided when doing queues.
There are many publish and subscribe modes for message queues. There is a mode where a message can be obtained by multiple consumers. There is a mode where a message is sent to a designated consumer. Choose the one that suits you~
You can use rabbitmq for the one you mentioned. direct mode
Any message queue that claims to be a message queue service will guarantee this, so there is no need to worry. But it should be noted that the message queue has two modes, the producer-consumer mode and the publisher-subscriber mode. The former guarantees that each message will only be consumed once, and the latter guarantees that each message can reach all subscribers, so The number of times consumed is uncertain.