doc-exports/docs/dcs/umn/dcs-faq-0730011.html
Chen, Junjie ea05d1a734 DCS UMN Initial Version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Chen, Junjie <chenjunjie@huawei.com>
Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
2022-12-12 14:07:56 +00:00

16 lines
2.4 KiB
HTML

<a name="dcs-faq-0730011"></a><a name="dcs-faq-0730011"></a>
<h1 class="topictitle1">What Should Be Noted When Using Redis for Pub/Sub?</h1>
<div id="body1596093268949"><p id="dcs-faq-0730011__en-us_topic_0152099099_p1016844615317">Pay attention to the following issues when using <span class="keyword" id="dcs-faq-0730011__keyword164002810011">Redis for pub/sub</span>:</p>
<ul id="dcs-faq-0730011__en-us_topic_0152099099_ul198440511594"><li id="dcs-faq-0730011__en-us_topic_0152099099_li984415575911">Your client must process messages in a timely manner.<p id="dcs-faq-0730011__en-us_topic_0152099099_p21880373116"><a name="dcs-faq-0730011__en-us_topic_0152099099_li984415575911"></a><a name="en-us_topic_0152099099_li984415575911"></a>Your client subscribes to a channel. If it does not receive messages in a timely manner, DCS instance messages may be overstocked. If the size of accumulated messages reaches the threshold (32 MB by default) or remains at a certain level (8 MB by default) for a certain period of time (1 minute by default), your client will be automatically disconnected to prevent server memory exhaustion.</p>
</li><li id="dcs-faq-0730011__en-us_topic_0152099099_li178449595911">Your client must support connection re-establishment in case of disconnection.<p id="dcs-faq-0730011__en-us_topic_0152099099_p96981571315"><a name="dcs-faq-0730011__en-us_topic_0152099099_li178449595911"></a><a name="en-us_topic_0152099099_li178449595911"></a>In the event of a disconnection, you need to run the <strong id="dcs-faq-0730011__b639911154011">subscribe </strong>or <strong id="dcs-faq-0730011__b24044151804">psubscribe</strong> command on your client to subscribe to a channel again. Otherwise, your client cannot receive messages.</p>
</li><li id="dcs-faq-0730011__en-us_topic_0152099099_li208447517592">Do not use pub/sub in scenarios with high message reliability requirements.<p id="dcs-faq-0730011__en-us_topic_0152099099_p1950115381025"><a name="dcs-faq-0730011__en-us_topic_0152099099_li208447517592"></a><a name="en-us_topic_0152099099_li208447517592"></a>The Redis pub/sub is not a reliable messaging system. Messages that are not retrieved will be discarded when your client is disconnected or a master/standby switchover occurs.</p>
</li></ul>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dcs-faq-0326020.html">Client and Network Connection</a></div>
</div>
</div>