Rückbau auf einen Consumer, der in `onPartitionsRevoked()` immer committed
[demos/kafka/training] / src / main / java / de / juplo / kafka / EndlessConsumer.java
index 0f3316d..f0e74d3 100644 (file)
@@ -26,7 +26,7 @@ public class EndlessConsumer<K, V> implements Runnable
   private final String topic;
   private final Consumer<K, V> consumer;
   private final ConsumerRebalanceListener rebalanceListener;
-  private final RecordHandler<K, V> handler;
+  private final RecordHandler<K, V> recordHandler;
 
   private final Lock lock = new ReentrantLock();
   private final Condition condition = lock.newCondition();
@@ -63,17 +63,15 @@ public class EndlessConsumer<K, V> implements Runnable
               record.value()
           );
 
-          handler.accept(record);
+          recordHandler.accept(record);
 
           consumed++;
         }
-
-        handler.beforeNextPoll();
       }
     }
     catch(WakeupException e)
     {
-      log.info("{} - RIIING! Request to stop consumption - commiting current offsets!", id);
+      log.info("{} - RIIING! Request to stop consumption.", id);
       shutdown();
     }
     catch(RecordDeserializationException e)