package com.jasongj.kafka.connect;

import java.util.Collection;
import java.util.Map;

import org.apache.kafka.clients.consumer.OffsetAndMetadata;
import org.apache.kafka.common.TopicPartition;
import org.apache.kafka.connect.sink.SinkRecord;
import org.apache.kafka.connect.sink.SinkTask;

public class ConsoleSinkTask extends SinkTask {

    @Override
    public String version() {
        return null;
    }

    @Override
    public void flush(Map<TopicPartition, OffsetAndMetadata> arg0) {

    }

    @Override
    public void put(Collection<SinkRecord> arg0) {

    }

    @Override
    public void start(Map<String, String> arg0) {

    }

    @Override
    public void stop() {

    }

}

@@ -29,16 +29,44 @@
 nnect;%0A%0A
+import java.io.PrintStream;%0A
 import j
@@ -212,24 +212,76 @@
 cPartition;%0A
+import org.apache.kafka.common.utils.AppInfoParser;%0A
 import org.a
@@ -410,24 +410,62 @@
 SinkTask %7B%0A%0A
+    private PrintStream printStream;%0A%0A
     @Overrid
@@ -515,12 +515,34 @@
 urn 
-null
+AppInfoParser.getVersion()
 ;%0A  
@@ -621,24 +621,102 @@
 tadata%3E 
-arg0) %7B%0A
+offsets) %7B%0A        if(printStream != null)%7B%0A            printStream.flush();%0A        %7D
 %0A    %7D%0A%0A
@@ -772,24 +772,73 @@
 Record%3E 
-arg0) %7B%0A
+records) %7B%0A        records.forEach(printStream::println);
 %0A    %7D%0A%0A
@@ -897,62 +897,178 @@
 ng%3E 
-arg0) %7B%0A%0A    %7D%0A%0A    @Override%0A    public void stop() %7B
+config) %7B%0A        this.printStream = System.out;%0A    %7D%0A%0A    @Override%0A    public void stop() %7B%0A        if(printStream != null)%7B%0A            printStream.close();%0A        %7D
 %0A%0A  

Implement ConsoleSinkTask