简体   繁体   English

Kafka Streams 的 processing.guarantee 设置为 EXACTLY_ONCE 问题

[英]Kafka Streams with processing.guarantee set up to EXACTLY_ONCE issue

I'm working on a development environment with 3 (dockerized) kafka brokers on my system.我正在开发一个在我的系统上有 3 个(dockerized)kafka 代理的开发环境。 The brokers have transaction.state.log.replication.factor set up to 3.代理将 transaction.state.log.replication.factor 设置为 3。

In stream application config I set processing.guarantee as EXACTLY_ONCE and in consumer application config I set isolation.level as "read_committed".在流应用程序配置中,我将 processing.guarantee 设置为 EXACTLY_ONCE,在消费者应用程序配置中,我将隔离级别设置为“read_committed”。

I have checked other configurations on https://docs.confluent.io/current/streams/developer-guide/config-streams.html#processing-guarantee and I set up my environment according to the guide.我已经在https://docs.confluent.io/current/streams/developer-guide/config-streams.html#processing-guarantee上检查了其他配置,并根据指南设置了我的环境。

After a minute of message production from stream application that reads a state store and produces 100 message using context.forward(..) function, the consumer application stops reading, as if there wasn't any commited messages on the assigned partitions.从流应用程序读取状态存储并使用 context.forward(..) 函数生成 100 条消息一分钟后,消费者应用程序停止读取,就好像分配的分区上没有任何提交的消息一样。

After some time the stream application crashes with the following error:一段时间后,流应用程序崩溃并出现以下错误:

"Aborting producer batches due to fatal error org.apache.kafka.common.errors.ProducerFencedException: Producer attempted an operation with an old epoch. Either there is a newer producer with the same transactionalId, or the producer's transaction has been expired by the broker." “由于致命错误 org.apache.kafka.common.errors.ProducerFencedException 导致生产者批次中止:生产者尝试使用旧时代进行操作。要么有一个具有相同事务 ID 的新生产者,要么生产者的交易已被经纪人过期.”

It seems like the stream producer cannot receive the ack and the transaction expires.似乎流生产者无法收到确认并且交易过期。

Edit 1: When I stop the stream application, the consumer receives commited messages.编辑 1:当我停止流应用程序时,消费者收到提交的消息。

推进Kafka服务器和客户端版本似乎解决了问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM