mq消息存储

  1. comitlog文件
  2. ConsumerQueue文件
  3. IndexFile文件

RocketMQ将所有主题的消息存储在同一个文件中,确保消息发送时顺序写文件。

为了提高消息消费的效率RocketMQ引入了ConsumeQueue消息队列文件,每个消息主题包含一个多个消息消费队列,每一个消费队列有一个消费文件。消息到达CommitLog文件后,将异步转发到消息消费队列

为了加速消息的检索性能,引入IndexFile索引文件,根据消息的属性快速从Commitlog文件中检索消息。存储消息Key与Offset的对应关系。

  1. messageStoreConfig消息存储配置属性
  2. commitLog文件的存储实现类
  3. consumeQueueTable消息队列缓存列表,按消息主题分组
  4. flushConsumeQueueService消息队列文件ConsumeQueue刷盘线程
  5. cleanCommitLogService清除CommitLog文件服务
  6. cleanConsumeQueueService 清除ConsumeQueue文件服务
  7. indexService 索引文件实现类
  8. allocateMappedFileService MappedFile分配服务
  9. reputMessageService  commitLog消息分发,根据CommitLog文件构建ConsumeQueue,IndexFile。
  10. haService存储HA机制
  11. transientStorePool消息堆内存缓存
  12. MessageArrivingListener 消息拉去长轮询模式达到监听器
  13. brokerConfig。Broker配置属性
  14. storeCheckpoint 文件刷盘检查点
  15. dispatcherList。CommitLog文件转发请求

猜你喜欢

转载自www.cnblogs.com/lccsblog/p/12203807.html