What is the difference between redis message queuing and publish / subscribe system? How do you choose?

what is the difference between the blocking message queue
implemented with jedis"s BRPOP and BLPOP and the
publish / subscribe system implemented using jedis"s subscribe and publish
, and how to choose?


when the message queue is blocked by BRPOP and BLPOP, the message queue will be disconnected automatically when you get the data. If you want to obtain the data continuously, you need to add your own listener during program design, while this will not happen with subscribe and publish. The subscriber itself will listen to the sender all the time.


BRPOP is for a scenario where a message has only one consumer. Queue
subscribe similar to AMQ is for a scenario where a message has multiple consumers, similar to AMQ's topic


an one-to-one consumption list
an one-to-many consumption subscription

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e95ac3-1579.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e95ac3-1579.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?