use of com.huawei.flowrecordreplay.console.rtc.consumer.strategy.InterfaceTopicHandleStrategy in project Sermant by huaweicloud.
the class RtcConsumer method logicProcess.
private void logicProcess(String topic, List<ConsumerRecord<String, String>> records, TopicPartition topicPartition) {
InterfaceTopicHandleStrategy handler = topicHandleStrategyFactory.getTopicHandleStrategy(topic);
try {
handler.handleRecordByTopic(records);
// 实时记录redis中各分区的消费偏移量offset
String offset = String.valueOf(records.get(records.size() - 1).offset() + 1);
redisUtil.set(topicPartition.topic() + ":" + topicPartition.partition(), offset);
LOGGER.debug("real time partition:{}, offset:{}", topicPartition, offset);
} catch (RedisException ex) {
LOGGER.error("task process error", ex);
}
}
Aggregations