com.mongodb.kafka.connect.MongoSinkConnector protobuf with recordNameStrategy

68 Views Asked by At

Using protobuf I can connect to mongoDB using the topicNameStrategy, but I can not using the recordNameStrategy, I have these configs

// taskConfig := rest.TaskConfig{
    taskConfig := map[string]interface{}{
        "connector.class":                       "com.mongodb.kafka.connect.MongoSinkConnector",
        "topics":                                "my-topic",
        "key.converter.schemas.enable":          "false",
        "key.converter":                         "org.apache.kafka.connect.storage.StringConverter",
        "value.converter.schema.registry.url":   "http://schema-registry:8081",
        "value.converter":                       "io.confluent.connect.protobuf.ProtobufConverter",
        "value.converter.subject.name.strategy": "io.confluent.kafka.serializers.subject.RecordNameStrategy",
        "connection.uri":                        "mongodb://mongo:27017",
        "database":                              "my-database",
        "collection":                            "my-collection",
        "tasksMax":                              "1",
    }

I read that "value.converter.subject.name.strategy": "io.confluent.kafka.serializers.subject.RecordNameStrategy" is for Avro schema ? Any hint how to configure the mongo connector to read protobuf events with the recordNameStrategy ?

0

There are 0 best solutions below