Class VerifiableSinkTask

java.lang.Object
org.apache.kafka.connect.sink.SinkTask
org.apache.kafka.connect.tools.VerifiableSinkTask
All Implemented Interfaces:
org.apache.kafka.connect.connector.Task

public class VerifiableSinkTask extends org.apache.kafka.connect.sink.SinkTask
Counterpart to VerifiableSourceTask that consumes records and logs information about each to stdout. This allows validation of processing of messages by sink tasks on distributed workers even in the face of worker restarts and failures. This task relies on the offset management provided by the Kafka Connect framework and therefore can detect bugs in its implementation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     

    Fields inherited from class org.apache.kafka.connect.sink.SinkTask

    TOPICS_CONFIG, TOPICS_REGEX_CONFIG
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    flush(Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets)
     
    void
    put(Collection<org.apache.kafka.connect.sink.SinkRecord> records)
     
    void
     
    void
     
     

    Methods inherited from class org.apache.kafka.connect.sink.SinkTask

    close, initialize, open, preCommit

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • VerifiableSinkTask

      public VerifiableSinkTask()
  • Method Details

    • version

      public String version()
    • start

      public void start(Map<String,String> props)
      Specified by:
      start in interface org.apache.kafka.connect.connector.Task
      Specified by:
      start in class org.apache.kafka.connect.sink.SinkTask
    • put

      public void put(Collection<org.apache.kafka.connect.sink.SinkRecord> records)
      Specified by:
      put in class org.apache.kafka.connect.sink.SinkTask
    • flush

      public void flush(Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets)
      Overrides:
      flush in class org.apache.kafka.connect.sink.SinkTask
    • stop

      public void stop()
      Specified by:
      stop in interface org.apache.kafka.connect.connector.Task
      Specified by:
      stop in class org.apache.kafka.connect.sink.SinkTask