Thursday, March 23, 2023

Kafka Connect Connector Arayüzü

Giriş
Şu satırı dahil ederiz
import org.apache.kafka.connect.connector.Connector;
Kalıtım örnekleri şöyle
  io.confluent.connect.jdbc.JdbcSourceConnector

  io.debezium.connector.mongodb.MongoDbConnector
  io.debezium.connector.mysql.MySqlConnector
  io.debezium.connector.postgresql.PostgresConnector

start metodu - Map
Connector başlar.

taskConfigs metodu
İmzası şöyle
public abstract List<Map<String, String>> taskConfigs(int maxTasks);
Sink Connector Açısından
Açıklaması şöyle. Yani kaç tane gerekiyorsa o kadar Task başlatılıyor
The exact algorithm is internal to Kafka-Connect but it generally relates to the number of partitions and topics. So for example if you set tasks.max = 10 and have the following sink connector configuration:

- 1 topic, 1 partition - then Kafka connect will only spawn a single task
- 2 topics, 1 partition each - then Kafka connect will spawn 2 tasks, 1 for each topic
- 2 topics, 5 partitions each - then Kafka connection will spawn 10 tasks, 1 for each topic partition
- 4 topics, 5 partitions each - the Kafka connection will spawn 10 tasks, each handling data from 2 topic partitions.




No comments:

Post a Comment

kafka-consumer-groups.sh komutu

Giriş Bir topic'i dinleyen consumer'ları gösterir. Aynı topic'i dinleyen consumer group'ları olabilir. Her topic farklı part...