From 7b36790f3587b206cd4b74cd9e345a509f2c771d Mon Sep 17 00:00:00 2001 From: Jeremy Custenborder Date: Tue, 27 Mar 2018 11:32:38 -0500 Subject: [PATCH] Corrected offset. fixes #40 --- .../kafka/connect/spooldir/SpoolDirJsonSourceTask.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/jcustenborder/kafka/connect/spooldir/SpoolDirJsonSourceTask.java b/src/main/java/com/github/jcustenborder/kafka/connect/spooldir/SpoolDirJsonSourceTask.java index e8a3ed2..53128d6 100644 --- a/src/main/java/com/github/jcustenborder/kafka/connect/spooldir/SpoolDirJsonSourceTask.java +++ b/src/main/java/com/github/jcustenborder/kafka/connect/spooldir/SpoolDirJsonSourceTask.java @@ -61,7 +61,7 @@ protected void configure(InputStream inputStream, Map metadata, if (null != lastOffset) { int skippedRecords = 0; - while (this.iterator.hasNext() && skippedRecords < lastOffset) { + while (this.iterator.hasNext() && skippedRecords <= lastOffset) { next(); skippedRecords++; } @@ -77,7 +77,7 @@ JsonNode next() { } @Override - protected List process() throws IOException { + protected List process() { List records = new ArrayList<>(this.config.batchSize); while (this.iterator.hasNext() && records.size() < this.config.batchSize) {