redis- publish and subscribe model

A message is sent
    Command: publish channel msg;
    Command Description: publish as a key to indicate the use of posted messages feature; channel is the main channel or meaning, it refers to the dissemination of information on a particular subject or channels; msg is to publish the news
 
Second, subscribe to news
    命令:subscribe channel [channel…] 
    Command Description: subscribe keyword, represents a subscription channel theme (one or more); channel said to be subscribed threads;
 
Third, the problems that may arise and conjectures
(1) When redis-client subscribe to a channel, whether the channel had received a message posted in?
            Test case: a publish (publisher), 2 subscriber (after the subscription before the news release and news release subscription),
            If you subscribe to the news released after the subscriber to receive information before the release, then the message is stored in redis-server end, when a cli subscription channel, server will be released once the all news channel are pushed to cli .  
            
    Test Conclusion: The information is not stored server-side topic had been sent after the subscription client does not receive the information before the subscription.

Guess you like

Origin www.cnblogs.com/zhaohuaxishi/p/12068222.html