Interface ErrantRecordReporter


public interface ErrantRecordReporter
Component that the sink task can use as it SinkTask.put(java.util.Collection). Reporter of problematic records and the corresponding problems.
Since:
2.6
  • Method Summary

    Modifier and Type Method Description
    Future<Void> report​(SinkRecord record, Throwable error)
    Report a problematic record and the corresponding error to be written to the sink connector's dead letter queue (DLQ).
  • Method Details

    • report

      Future<Void> report​(SinkRecord record, Throwable error)
      Report a problematic record and the corresponding error to be written to the sink connector's dead letter queue (DLQ).

      This call is asynchronous and returns a Future. Invoking get() on this future will block until the record has been written or throw any exception that occurred while sending the record. If you want to simulate a simple blocking call you can call the get() method immediately. Connect guarantees that sink records reported through this reporter will be written to the error topic before the framework calls the SinkTask.preCommit(java.util.Map) method and therefore before committing the consumer offsets. SinkTask implementations can use the Future when stronger guarantees are required.

      Parameters:
      record - the problematic record; may not be null
      error - the error capturing the problem with the record; may not be null
      Returns:
      a future that can be used to block until the record and error are reported to the DLQ
      Throws:
      ConnectException - if the error reporter and DLQ fails to write a reported record
      Since:
      2.6