indexFile(索引文件)和 ConsumeQueue(消费队列),都是为了更快的查找而建立的索引,后者是根据topic,前者是根据key。在ReputMessageService(一个ServiceThread的实现类)的doReput方法中,会循环遍历每一条新收到的消息,
DefaultMessageStore.this.doDispatch(dispatchRequest)-->CommitLogDispatcherBuildIndex/CommitLogDispatcherBuildConsumeQueue .doDispatch,
先看前者,到了indexService.buildIndex,
RocketMQ源码 索引文件/indexFile 和 消费队列/ConsumeQueue
原文:https://www.cnblogs.com/chuliang/p/15173191.html