开发者社区 > 云原生 > 消息队列 > 正文

RocketMQ这个逻辑太奇怪了吧?

0bab6c1db8a95c6c948251b2f772a18a.png
RocketMQ这个逻辑太奇怪了吧?应该是满足条件 deliverTimestamp + ScheduleMessageService.this.delayLevelTable.get(this.delayLevel) > now
触发延时消息

展开
收起
嘟嘟嘟嘟嘟嘟 2024-06-05 08:35:18 14 0
1 条回答
写回答
取消 提交回答
  • deliverTimestamp 是定时消息执行的时间吧,deliverTimestamp > now 就可以触发了。你看后面还有一个逻辑

           long countdown = deliverTimestamp - now;
                    if (countdown > 0) {
                        this.scheduleNextTimerTask(nextOffset, DELAY_FOR_A_WHILE);
                        return;
                    }
    

    此回答整理自钉群“群2-Apache RocketMQ 中国开发者钉钉群”

    2024-06-05 10:24:30
    赞同 1 展开评论 打赏

多个子产品线联合打造金融级高可用消息服务以及对物联网的原生支持,覆盖多行业。

相关产品

  • 云消息队列 MQ
  • 热门讨论

    热门文章

    相关电子书

    更多
    RocketMQ Client-GO 介绍 立即下载
    RocketMQ Prometheus Exporter 打造定制化 DevOps 平台 立即下载
    基于 RocketMQ Prometheus Exporter 打造定制化 DevOps 平台 立即下载