Apache kafka Kafka:使用ApacheBeam的精确语义配置
我正试图在Kafka(apachebeam)中精确地配置一次语义。 以下是我将要介绍的变化: 制作人:Apache kafka Kafka:使用ApacheBeam的精确语义配置,apache-kafka,google-cloud-dataflow,apache-beam,apache-beam-io,Apache Kafka,Google Cloud Dataflow,Apache Beam,Apache Beam Io,我正试图在Kafka(apachebeam)中精确地配置一次语义。 以下是我将要介绍的变化: 制作人: 启用.idenpotence=true transactional.id=uniqueTransactionalId 消费者: 设置enable.auto.commit=false //将以下内容添加到consumer builder: .committeofsetsinfinalize() .withReadCommitted() 将以下内容添加到KafkaIO#write生成器中
启用.idenpotence
=true
transactional.id
=uniqueTransactionalId
enable.auto.commit
=false
//将以下内容添加到consumer builder:
.committeofsetsinfinalize()
.withReadCommitted()
KafkaIO#write
生成器中:
.withEOS(numShards,sinkGroupId)
如果我不使用事务API(因为我在apache beam中没有显式的生产者),我是否需要指定
transactional.id
属性?看来我终于找到了适合我要求的正确设置。以下是我的结论:
1) KafkaIO.Read
:
- 使用
enable.auto.commit=false更新使用者属性
.withReadCommitted()
.committeofsetsinfinalize()
KafkaIO#write
:
它还将启用幂等性,并为制作人设置引擎盖下的.withEOS(numShards,sinkGroupId)
transactional.id