Hi, my kafka topic has key and value schemas like this :
key.avsc
{
“namespace”: “tx.avro”,
“type”: “record”,
“name”: “key”,
“fields”: [
{
“name”: “userid”, “type”: “string”, “default”: “null”
}
]
}
value.avsc
{
“namespace”: “tx.avro”,
“type”: “record”,
“name”: “value”,
“fields”: [
{
“name”: “username”, “type”: “string”
},
{
“name”: “result”, “type”: “string”
}
]
}
via mongodb sink connector, only (username, result) are sinked.
how to sink the key (userid) of topic via mongodb sink connector ?
connector config is like this:
curl -X PUT http://connector01:8083/connectors/tx-data-connect03-1/config -H "Content-Type: application/json" -d ' {
"connector.class":"com.mongodb.kafka.connect.MongoSinkConnector",
"topics":"tx-data-kv-03",
"tasks.max":"2",
"connection.uri":"mongodb://admin:xxxxxxxx@10.10.10.10:27011",
"database":"sytx",
"collection":"txdata1",
"key.ignore": "false",
"key.converter": "io.confluent.connect.avro.AvroConverter",
"value.converter": "io.confluent.connect.avro.AvroConverter",
"value.converter.schema.registry.url": "http://sch1:8081",
"key.converter.schema.registry.url": "http://sch1:8081"
} '