sfc-gh-lkucharski commented on code in PR #10881:
URL: https://github.com/apache/nifi/pull/10881#discussion_r2797629857
##########
nifi-extension-bundles/nifi-aws-bundle/nifi-aws-kinesis/src/main/java/org/apache/nifi/processors/aws/kinesis/MemoryBoundRecordBuffer.java:
##########
@@ -504,7 +508,13 @@ List<KinesisClientRecord> consumeRecords() {
recordsToConsume.addAll(batch.records());
}
- return recordsToConsume;
+ final Long maxMillisBehindLatest = inProgressBatches.stream()
+ .map(RecordBatch::millisBehindLatest)
+ .filter(Objects::nonNull)
+ .min(Long::compareTo)
Review Comment:
@awelless I think it's better to take the last value as you suggest. Thanks.
As for the nullability, since the value returned is of type Long and I did not
see anything about non null in the docs I'd feel safer to check this for null:
<img width="2242" height="201" alt="image"
src="https://github.com/user-attachments/assets/379e7548-e302-45b6-8c57-12d528caa71c"
/>
--
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]