chia7712 commented on code in PR #24239:
URL: https://github.com/apache/kafka/pull/24239#discussion_r4667247248


##########
server/src/main/java/org/apache/kafka/server/share/dlq/ShareGroupDLQStateManager.java:
##########
@@ -1043,8 +1046,13 @@ private static MemoryRecords 
mergeRecords(List<MemoryRecords> recordsList) {
         }
         List<SimpleRecord> simpleRecords = new ArrayList<>();
         for (MemoryRecords records : recordsList) {
-            for (Record record : records.records()) {
-                simpleRecords.add(new SimpleRecord(record.timestamp(), 
record.key(), record.value(), record.headers()));
+            for (RecordBatch batch : records.batches()) {

Review Comment:
   ```java
           for (MemoryRecords records : recordsList) {
               try (CloseableIterator<Record> iterator = records.records()) {
                   while (iterator.hasNext()) {
                       Record record = iterator.next();
                       simpleRecords.add(new SimpleRecord(record.timestamp(), 
record.key(), record.value(), record.headers()));
                   }
               }
           }
   ```



-- 
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]

Reply via email to