kafka报错No group.id found in consumer config
Caused by: java.lang.IllegalStateException: No group.id found in consumer config, container properties, or @KafkaListener annotation; a group.id is required when group management is used.
Caused by: java.lang.IllegalStateException: No group.id found in consumer config, container properties, or @KafkaListener annotation; a group.id is required when group management is used.
at org.springframework.util.Assert.state(Assert.java:76) ~[spring-core-5.3.21.jar:5.3.21]
at org.springframework.kafka.listener.AbstractMessageListenerContainer.checkGroupId(AbstractMessageListenerContainer.java:520) ~[spring-kafka-2.8.7.jar:2.8.7]
at org.springframework.kafka.listener.AbstractMessageListenerContainer.start(AbstractMessageListenerContainer.java:456) ~[spring-kafka-2.8.7.jar:2.8.7]
at org.springframework.kafka.config.KafkaListenerEndpointRegistry.startIfNecessary(KafkaListenerEndpointRegistry.java:347) ~[spring-kafka-2.8.7.jar:2.8.7]
at org.springframework.kafka.config.KafkaListenerEndpointRegistry.start(KafkaListenerEndpointRegistry.java:292) ~[spring-kafka-2.8.7.jar:2.8.7]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178) ~[spring-context-5.3.21.jar:5.3.21]
... 14 common frames omitted
分析:
报错提示没有配置groupid,那么配置groupid即可
解决方案
配置group-id,重启服务器即可文章来源:https://www.toymoban.com/news/detail-511617.html
spring:
kafka:
bootstrap-servers: xxx:9092
consumer:
group-id: abc #设置消费者的groupid
文章来源地址https://www.toymoban.com/news/detail-511617.html
到了这里,关于kafka报错:No group.id found in consumer config, container properties的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!