我有四个运行相同应用程序ID的kafkastream应用程序实例。所有输入主题都是单一分区。为了实现可伸缩性,我已经通过具有多个分区的中间虚拟主题传递了它。我已将request.timeout.ms设置为4分钟。
kafka实例进入ERROR状态,不会抛出任何异常。很难弄清楚究竟是什么问题。有什么想法吗?
[INFO ] 2018-01-09 12:30:11.579 [app-new-03-cb952917-bd06-4932-8c7e-62986126a5b4-StreamThread-1] StreamThread:939 - stream-thread [app-new-03-cb952917-bd06-4932-8c7e-62986126a5b4-StreamThread-1] Shutting down
[INFO ] 2018-01-09 12:30:11.579 [app-new-03-cb952917-bd06-4932-8c7e-62986126a5b4-StreamThread-1] StreamThread:888 - stream-thread [app-new-03-cb952917-bd06-4932-8c7e-62986126a5b4-StreamThread-1] State transition from RUNNING to PENDING_SHUTDOWN.
[INFO ] 2018-01-09 12:30:11.595 [app-new-03-cb952917-bd06-4932-8c7e-62986126a5b4-StreamThread-1] KafkaProducer:972 - Closing the Kafka producer with timeoutMillis = 9223372036854775807 ms.
[INFO ] 2018-01-09 12:30:11.605 [app-new-03-cb952917-bd06-4932-8c7e-62986126a5b4-StreamThread-1] StreamThread:972 - stream-thread [app-new-03-cb952917-bd06-4932-8c7e-62986126a5b4-StreamThread-1] Stream thread shutdown complete
[INFO ] 2018-01-09 12:30:11.605 [app-new-03-cb952917-bd06-4932-8c7e-62986126a5b4-StreamThread-1] StreamThread:888 - stream-thread [app-new-03-cb952917-bd06-4932-8c7e-62986126a5b4-StreamThread-1] State transition from PENDING_SHUTDOWN to DEAD.
[WARN ] 2018-01-09 12:30:11.605 [app-new-03-cb952917-bd06-4932-8c7e-62986126a5b4-StreamThread-1] KafkaStreams:343 - stream-client [app-new-03-cb952917-bd06-4932-8c7e-62986126a5b4] All stream threads have died. The Kafka Streams instance will be in an error state and should be closed.
[INFO ] 2018-01-09 12:30:11.605 [new-03-cb952917-bd06-4932-8c7e-62986126a5b4-StreamThread-1] KafkaStreams:268 - stream-client [app-new-03-cb952917-bd06-4932-8c7e-62986126a5b4] State transition from RUNNING to ERROR.
答案 0 :(得分:1)
Thea asker在评论中分享了他的解决方案:
一旦我更改了有效的消费者组ID。
还值得注意的是,相关问题(可能有或没有相同的根本原因)已在最新版本中引入,并且在Kafka 2.5.1和更高版本中现在看起来也fixed以上2.6.0。
因此今天遇到这种情况的人们可能想检查他们是否处于高(或低)版本以免发生此问题。
答案 1 :(得分:-1)
您可能还需要将 default.production.exception.handler Kafka Streams 属性设置为实现 ProductionExceptionHandler 的类,并且与默认类 DefaultProductionExceptionHandler 不同,在触发永久故障状态之前记录错误。