问题描述
我创建了一个接收器kafka连接,可将数据转换为其他存储;当我使用 kafka connect rest api
创建新的连接器时,我想将 auto.offset.reset
设置为 latest
;我已经在配置中设置了 consumer.auto.offset.reset:Latest
;
I have create a sink kafka connect that convert data to other storage; I want to set auto.offset.reset
as latest
when new connector is created with kafka connect rest api
; I have set consumer.auto.offset.reset: latest
in configs;
json{"name":"test_v14",配置":{"name":"test_v14","consumer.auto.offset.reset":最新","connector.class":"...",...}}
但是,当任务开始时,kafka消费者仍然从最早开始轮询记录;将 auto.offset.reset
设置为最新的其他方法也是如此;
But when task started, kafka consumer still poll records from earliest; So is any other ways to set auto.offset.reset
as latest;
推荐答案
Kafka 2.3之前的版本
consumer.auto.offset.reset
.
除非该连接器类显式创建并加载其自身的读取该属性的Consumer对象,否则它不能应用于任何特定的连接器.
It cannot be applied to any particular Connector unless that connector class is explicitly creating and loading its own Consumer objects that read in that property.
这篇关于如何使用REST API设置kafka连接auto.offset.reset的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!