kafka消费过程难免会遇到需要重新消费的场景,例如我们消费到kafka数据之后需要进行存库操作,若某一时刻数据库down了,导致kafka消费的数据无法入库,为了弥补数据库down期间的数据损失,有一种做法我们可以指定kafka消费者的offset到之前某一时间的数值,然后重新进行消费. 首先创建kafka消费服务 @Service @Slf4j //实现CommandLineRunner接口,在springboot启动时自动运行其run方法. public class TspLogbookA…
案例分析 处理kafka consumer的程序的时候,发现如下错误: ERROR [2016-07-22 07:16:02,466] com.flow.kafka.consumer.main.KafkaConsumer: Unexpected Error Occurred ! kafka.common.MessageSizeTooLargeException: Found a message larger than the maximum fetch size of this consumer…