在Flink KafkaSource中设置ConsumerConfig.GROUP_ID_CONFIG参数可以解决该问题。例如:
FlinkKafkaConsumer011 kafkaSource = new FlinkKafkaConsumer011<>("topic", new SimpleStringSchema(), properties);
kafkaSource.setStartFromLatest();
properties.setProperty(ConsumerConfig.GROUP_ID_CONFIG, "my-consumer-group-id"); //设置group.id