Nicht ausgewertete Unterscheidung entfernt
authorKai Moritz <kai@juplo.de>
Sun, 5 Jan 2025 11:24:51 +0000 (12:24 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 5 Jan 2025 11:24:51 +0000 (12:24 +0100)
src/main/java/de/juplo/kafka/ExampleConsumer.java

index 8c1aff7..c720815 100644 (file)
@@ -109,8 +109,6 @@ public class ExampleConsumer implements ConsumerRebalanceListener, Runnable
               recordsForPartition.size(),
               topicPartition);
 
-            boolean partitionHasRetryableError = false;
-
             for (ConsumerRecord<String, Long> record : recordsForPartition)
             {
               if (abortCurrentPoll)
@@ -155,7 +153,6 @@ public class ExampleConsumer implements ConsumerRebalanceListener, Runnable
                     record.offset(),
                     partition);
                   backOffState[partition] = new BackOffState(topicPartition, record.offset());
-                  partitionHasRetryableError = true;
                   consumer.seek(topicPartition, record.offset());
                   break;
                 }
@@ -177,7 +174,6 @@ public class ExampleConsumer implements ConsumerRebalanceListener, Runnable
                       record.offset(),
                       partition);
                     consumer.seek(topicPartition, record.offset());
-                    partitionHasRetryableError = true;
                     break;
                   }
                 }
@@ -188,10 +184,7 @@ public class ExampleConsumer implements ConsumerRebalanceListener, Runnable
                 log.warn("{} - Ignoring non-retryable error!", id, e);
               }
 
-              if (!partitionHasRetryableError)
-              {
-                backOffState[topicPartition.partition()].markRetryAsSuccessful();
-              }
+              backOffState[topicPartition.partition()].markRetryAsSuccessful();
             }
           }
         }