Search in sources :

Example 1 with DeadLetterQueueReporter

use of org.apache.kafka.connect.runtime.errors.DeadLetterQueueReporter in project kafka by apache.

the class Worker method sinkTaskReporters.

private List<ErrorReporter> sinkTaskReporters(ConnectorTaskId id, SinkConnectorConfig connConfig, ErrorHandlingMetrics errorHandlingMetrics, Class<? extends Connector> connectorClass) {
    ArrayList<ErrorReporter> reporters = new ArrayList<>();
    LogReporter logReporter = new LogReporter(id, connConfig, errorHandlingMetrics);
    reporters.add(logReporter);
    // check if topic for dead letter queue exists
    String topic = connConfig.dlqTopicName();
    if (topic != null && !topic.isEmpty()) {
        Map<String, Object> producerProps = producerConfigs(id, "connector-dlq-producer-" + id, config, connConfig, connectorClass, connectorClientConfigOverridePolicy, kafkaClusterId);
        Map<String, Object> adminProps = adminConfigs(id, "connector-dlq-adminclient-", config, connConfig, connectorClass, connectorClientConfigOverridePolicy, kafkaClusterId);
        DeadLetterQueueReporter reporter = DeadLetterQueueReporter.createAndSetup(adminProps, id, connConfig, producerProps, errorHandlingMetrics);
        reporters.add(reporter);
    }
    return reporters;
}
Also used : ErrorReporter(org.apache.kafka.connect.runtime.errors.ErrorReporter) DeadLetterQueueReporter(org.apache.kafka.connect.runtime.errors.DeadLetterQueueReporter) ArrayList(java.util.ArrayList) LogReporter(org.apache.kafka.connect.runtime.errors.LogReporter)

Aggregations

ArrayList (java.util.ArrayList)1 DeadLetterQueueReporter (org.apache.kafka.connect.runtime.errors.DeadLetterQueueReporter)1 ErrorReporter (org.apache.kafka.connect.runtime.errors.ErrorReporter)1 LogReporter (org.apache.kafka.connect.runtime.errors.LogReporter)1