java - Questions about queues under concurrent operations?
PHP中文网
PHP中文网 2017-06-23 09:14:19
0
2
1032

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.

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
漂亮男人

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!