github-actions[bot] commented on code in PR #41624:
URL: https://github.com/apache/beam/pull/41624#discussion_r4682590791
##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaUnboundedReader.java:
##########
@@ -618,7 +618,7 @@ private void consumerPollLoop() {
try {
if (records.isEmpty()) {
stopwatch.start();
- records = consumer.poll(KAFKA_POLL_TIMEOUT.getMillis());
+ records = consumer.poll(KAFKA_POLL_TIMEOUT);
Review Comment:
**🔴 Critical**: `KAFKA_POLL_TIMEOUT` is declared as an
`org.joda.time.Duration` (`import org.joda.time.Duration;` on line 75 and
`private static final Duration KAFKA_POLL_TIMEOUT = Duration.millis(1000);` on
line 375), whereas `Consumer.poll(...)` expects `java.time.Duration`. Passing
`KAFKA_POLL_TIMEOUT` directly fails to compile.
Either change `KAFKA_POLL_TIMEOUT` on line 375 to `private static final
java.time.Duration KAFKA_POLL_TIMEOUT = java.time.Duration.ofMillis(1000);` or
convert it to `java.time.Duration` here.
```suggestion
records =
consumer.poll(java.time.Duration.ofMillis(KAFKA_POLL_TIMEOUT.getMillis()));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]