In some cases, when the Kafka data is imported to a Tablestore table, an error occurs. If you do not want a data import task that uses Tablestore Sink Connector to immediately fail when an error occurs, you can configure an error handling policy.

The following errors may occur:
  • Kafka Connect Error

    This error occurs before the data import task that uses Tablestore Sink Connector is executed. For example, this error can occur when you use Converter for deserialization or use Kafka Transformations to perform lightweight modification on message records. If this error occurs, you can configure the error handling option that is provided by Kafka.

    If you want to skip this error, specify errors.tolerance=all in the connector configuration file. For more information, see Kafka Connect Configs.

  • Tablestore Sink Task Error

    This error occurs when the data import task that uses Tablestore Sink Connector is in progress. For example, this error can occur when message records are being parsed or message records are being written to Tablestore. If this error occurs, you can configure the error handling option that is provided by Tablestore Sink Connector.

    If you want to skip this error, specify errors.tolerance=all in the connector configuration file. For more information, see Configuration description. You can also specify the method that is used to report errors. If you want to save the message records for which errors are reported and the error messages to a different data table in Tablestore, configure the following parameters:
    runtime.error.tolerance=all
    runtime.error.mode=tablestore
    runtime.error.table.name=error
    In the distributed mode, you can use the REST API to manage the connector and task. If the connector or task stops because an error occurs, you can manually restart the connector or task.
    1. Check the connector and task status.
      • Check the connector status:
        curl http://localhost:8083/connectors/{name}/status
      • Check the task status:
        curl http://localhost:8083/connectors/{name}/tasks/{taskid}/status

      In the preceding commands, http://localhost:8083/connectors is the address of the Kafka REST service, the value of name must be the same as the connector name in the configuration file, and taskid is included in the connector status information.

      You can run the following command to obtain the taskid value:
      curl http://localhost:8083/connectors/{name}/tasks
    2. Manually restart the connector or the task.
      • Restart the connector:
        curl -X POST http://localhost:8083/connectors/{name}/restart
      • Restart the task:
        curl -X POST http://localhost:8083/connectors/{name}/tasks/{taskId}/restart