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 14:53:04 UTC

[GitHub] [rocketmq] rockit-ba opened a new issue, #5985: 关于5.0定时消息原理问题

rockit-ba opened a new issue, #5985:
URL: https://github.com/apache/rocketmq/issues/5985

   我的一个疑问点是官方文档是这样说的
   <img width="815" alt="image" src="https://user-images.githubusercontent.com/53960157/216773779-3cc0df45-708e-4a12-b5d3-a081e74e1bee.png">
   
   如果将定时消息存储到 磁盘,那么定时任务是每秒从磁盘全量遍历吗,虽然我知道肯定不是这样实现的,但是又不可能把所有的延迟消息全部放在内存的延迟队列中,而且磁盘上的消息也做不到按照时间戳排序,因为一直有新的不同的消息进来。
   
   所以我比较好奇是如何实现的,或者有相关的文档吗


-- 
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.apache.org

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


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

Posted by "rockit-ba (via GitHub)" <gi...@apache.org>.
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


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

Posted by "rockit-ba (via GitHub)" <gi...@apache.org>.
rockit-ba commented on issue #5985:
URL: https://github.com/apache/rocketmq/issues/5985#issuecomment-1416896857

   > @rockit-ba 看一下这个文档https://shimo.im/docs/gXqme9PKKpIeD7qo/read
   
   好的,谢谢


-- 
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


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

Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm commented on issue #5985:
URL: https://github.com/apache/rocketmq/issues/5985#issuecomment-1416893937

   @rockit-ba  看一下这个文档https://shimo.im/docs/gXqme9PKKpIeD7qo/read


-- 
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


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

Posted by "rockit-ba (via GitHub)" <gi...@apache.org>.
rockit-ba closed issue #5985: 关于5.0定时消息原理问题
URL: https://github.com/apache/rocketmq/issues/5985


-- 
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