org.springframework.kafka.listener.ListenerExecutionFailedException: Listener method could not be invoked with the incoming message

发布时间 2024-01-12 16:32:16作者: 成佛在西天

问题描述

kafka在yml文件中未开启批量消费时,程序正常运行;但一开启正常消费后,就直接报错;排查问题的过程中一直觉得是配置文件里的问题,最后发现是消费者接受的参数类型错误

 

问题本质

  消费者开启批量消费数据后,不能用单个实体类接收参数,而应该用list

 

解决方法

  修改消费者函数参数类型