You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "rockit-ba (via GitHub)" <gi...@apache.org> on 2023/02/04 15:08:54 UTC

[GitHub] [rocketmq] rockit-ba commented on issue #5985: 关于5.0定时消息原理问题

rockit-ba commented on issue #5985:
URL: https://github.com/apache/rocketmq/issues/5985#issuecomment-1416777531

   RocketMQ 5.0 实现定时消息功能通过延迟队列和磁盘存储两种方式来实现。在内存中有一个延迟队列,它维护着所有的延迟消息,这些消息会在到达指定的延迟时间后被发送。定时任务会定期扫描延迟队列,将到期的消息发送出去。但是,如果延迟队列存储的消息太多,不可能全部存储在内存中。所以部分消息会存储到磁盘上。对于磁盘上的消息,RocketMQ会采用分块存储的方式,并使用二进制堆结构将其按照时间戳排序。这样可以避免频繁的磁盘读写操作,提高系统的性能。
   
   是这样做的吗


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org