Monday, August 28, 2023

Kafka Connect OracleCdcSourceConnector Sınıfı

Giriş
Açıklaması şöyle
Confluent’s Oracle CDC Source Connector (v1.0.0) utilizes Oracle LogMiner to read redo logs from the database. It supports Oracle Database versions 11g, 12c, 18c, and 19c. The connector can initiate synchronization either from a snapshot of the tables or from a specific Oracle system change number (SCN) or timestamp.
Plugin kurulu mu diye kontrol etmek için şöyle yaparız
curl -s -X GET -H 'Content-Type: application/json' http://localhost:8083/connector-plugins | 
  jq '.'
CDCConnector sınıfları JdbcSourceConnector sınıfından daha iyi çünkü değişiklikleri CDC ile tespit ediyor. JdbcSourceConnector ise değişiklikleri çok daha geç tespit eder.
 
Örnek
Şöyle yaparız
{
    "name": "oracle_cdc",
    "config":{
      "connector.class": "io.confluent.connect.oracle.cdc.OracleCdcSourceConnector",
      "name": "oracle_cdc",
      "tasks.max":1,
      "key.converter": "io.confluent.connect.avro.AvroConverter",
      "key.converter.schema.registry.url": "http://schema-registry:8081",
      "key.template": "${primaryKeyStructOrValue}",
      "value.converter": "io.confluent.connect.avro.AvroConverter",
      "value.converter.schema.registry.url": "http://schema-registry:8081",
      "confluent.topic.bootstrap.servers":"broker:29092",
      "oracle.server": "oracle",
      "oracle.port": 1521,
      "oracle.sid":"ORCLCDB",
      "oracle.username": "C##MYUSER",
      "oracle.password": "password",
      "start.from":"snapshot",
      "table.inclusion.regex":"ORCLCDB\\.C##MYUSER\\.BPM_(.*)",
      "table.exclusion.regex":"",
      "table.topic.name.template": "${fullyQualifiedTableName}",
      "connection.pool.max.size": 20,
      "confluent.topic.replication.factor":1,
      "redo.log.consumer.bootstrap.servers":"broker:29092",
      "redo.log.corruption.topic": "redo-corruption-topic",
      "topic.creation.groups": "redo",
      "topic.creation.redo.include": "redo-log-topic",
      "topic.creation.redo.replication.factor": 1,
      "topic.creation.redo.partitions": 1,
      "topic.creation.redo.cleanup.policy": "delete",
      "topic.creation.redo.retention.ms": 1209600000,
      "topic.creation.default.replication.factor": 1,
      "topic.creation.default.partitions": 1,
      "topic.creation.default.cleanup.policy": "delete"
    }
  }

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...