apache-kafkaapache-kafka-connectconfluent-schema-registrydebeziumchange-data-capture

Kafka connect oracle-cdc autogenerates schemas for every topic with the same name "ConnectDefault". Can it be customized per topic?


I'm using Kafka Connect with the oracle cdc (https://docs.confluent.io/kafka-connectors/oracle-cdc/current/overview.html) source connector to do CDC on some database tables. It creates a topic per table and autogenerates an Avro schema form each one. The problem is all schemas have the same namespace and name:

  "name": "ConnectDefault",
  "namespace": "io.confluent.connect.avro",
  "type": "record"

Can this be customized?

I've already tried setting different configuration properties in the connector config but none of the fixed the problem:

"value.converter.schema.name.strategy": "io.confluent.kafka.serializers.subject.TopicNameStrategy",

"value.converter.schema.registry.subject": "my.namespace.myname",

"transforms":"AddNamespace",
"transforms.AddNamespace.type":"org.apache.kafka.connect.transforms.SetSchemaMetadata$Value", 
"transforms.AddNamespace.timestamp.record.namespace":"example",
...

Solution

  • The correct property name for changing the subject is value.converter. + value.schema.name.strategy (you are missing the value part)

    schema.registry.subject is not a valid config; use the transform for that.

    https://docs.confluent.io/platform/current/schema-registry/fundamentals/serdes-develop/index.html#configuration-details

    But that will not change the namespace. For that, timestamp.record.namespace is not the correct property, either. It is schema.name

    https://docs.confluent.io/platform/current/connect/transforms/setschemametadata.html#properties