简体   繁体   中英

How to set kafka committedOffset in flink?

I already set committed offsetd by:

properties.setProperty("auto.commit.interval.ms", "1000");
properties.setProperty("auto.commit.enable", "true");
properties.setProperty("enable.auto.commit", "true");

FlinkKafkaConsumer08<MobilePageEvent> kafkaConsumer =
            new FlinkKafkaConsumer08<>(
                    "mobile-event.page-resource", SCHEMA, properties);

But in the web UI, I get invalid committed offsets:

在此处输入图片说明

After enabling check pointing, it works now:

StreamExecutionEnvironment environment =
            StreamExecutionEnvironment.getExecutionEnvironment();

environment.enableCheckpointing(5000);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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