Skip to content

Commit 39f1008

Browse files
committed
Replaced deprecated Kafka client poll with the recommended one
1 parent 5be06f4 commit 39f1008

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

datastream-kafka-connector/src/main/java/com/linkedin/datastream/connectors/kafka/AbstractKafkaBasedConnectorTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ protected void trackEventsProcessedProgress(int recordCount) {
508508
}
509509

510510
protected ConsumerRecords<?, ?> consumerPoll(long pollInterval) {
511-
return _consumer.poll(pollInterval);
511+
return _consumer.poll(Duration.ofMillis(pollInterval));
512512
}
513513

514514
/**

datastream-kafka-connector/src/main/java/com/linkedin/datastream/connectors/kafka/mirrormaker/KafkaMirrorMakerConnectorTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ protected void maybeCommitOffsets(Consumer<?, ?> consumer, boolean hardCommit) {
424424
// Kafka rejects a poll if there is empty assignment
425425
return ConsumerRecords.EMPTY;
426426
} else {
427-
return _consumer.poll(pollInterval);
427+
return _consumer.poll(Duration.ofMillis(pollInterval));
428428
}
429429
}
430430

0 commit comments

Comments
 (0)