Redis发布订阅模式-3

实现一个消息队列

本来打算利用Redis发布订阅模式来实现一个简单的消息队列,但我在工作中根本没用Redis来做消息队列。有几点原因

  1. 数据持久化。
  2. Redis只会发送消息给在线的消费者,处于离线状态的消费者将不会收到消息就算恢复过来。
  3. 没有ACK机制,发送者不知道消费者到底消费了吗。

基于以上的原因,就一直没有使用过Redis的来做消息队列,等以后有空再尝试写下,当然是需要把上面三个问题解决了。哈哈 ,懒了。

posted @ 2020-05-07 17:03  RstarYan  阅读(218)  评论(0编辑  收藏  举报
$(function(){ $('#blogTitle h1').addClass('bounceInLeft animated'); $('#blogTitle h2').addClass('bounceInRight animated'); // 删除反对按钮 $('.buryit').remove(); initCommentData(); }); function initCommentData() { $('.feedbackItem').each(function() { var text = $(this).find('.feedbackListSubtitle .layer').text(); // 将楼层信息放到data里面 // $(this).find('.blog_comment_body').attr('data-louceng', text.replace(/^#/g, '')); if($(this).find('.feedbackListSubtitle .louzhu').length>0) $(this).addClass('myself'); var avatar = $(this).find('> .feedbackCon > span').html() || 'https://pic.cnblogs.com/face/sample_face.gif'; $(this).find('> .feedbackCon > .blog_comment_body').append('') }); } $(document).ajaxComplete(function(event, xhr, settings) { // 监听获取评论ajax事件 if(settings.url.indexOf('/mvc/blog/GetComments.aspx') >= 0) { initCommentData(); } });