Broadcasting模式
存放于${user.home}/.rocketmq_offsets/MQClientId/ConsumerGroup/offsets.json
public class LocalFileOffsetStore
public final static String LOCAL_OFFSET_STORE_DIR = System.getProperty(
"rocketmq.client.localOffsetStoreDir",
System.getProperty("user.home") + File.separator + ".rocketmq_offsets");
this.mQClientFactory = mQClientFactory;
this.groupName = groupName;
this.storePath = LOCAL_OFFSET_STORE_DIR + File.separator +
this.mQClientFactory.getClientId() + File.separator +
this.groupName + File.separator +
"offsets.json";
}
}
Clustering模式
存放于storePathRootDir/config/consumerOffset.json
public class BrokerPathConfigHelper {
public static String getConsumerOffsetPath(final String rootDir) {
return rootDir + File.separator + "config" + File.separator + "consumerOffset.json";
}
}
//storePathRootDir broker配置项
public class ConsumerOffsetManager{
@Override
public String configFilePath() {
return BrokerPathConfigHelper.getConsumerOffsetPath(this.brokerController.getMessageStoreConfig().getStorePathRootDir());
}
}