Hello
I need to move a json message(where the scheme is not embedded ). I have a json message with only payload. I had tried jdbc sink connector but it failed. Is there any other possible connectors to move data from a topic to sql database?
The config i had used for my message is below:
class: io.confluent.connect.jdbc.JdbcSinkConnector
tasksMax: 1
config:
connection.url: jdbc:sqlserver://sqlsrv-tam-test.database.windows.net:1433;database=****;
connection.user: *******
connection.password:********
topics: fake.person.json.v0.dev
pk.mode: record_key
pk.fields: fake_key
auto.create: "false"
delete.enabled: "true"
key.converter: org.apache.kafka.connect.storage.StringConverter
key.converter.schemas.enable: "false"
value.converter: org.apache.kafka.connect.json.JsonConverter
value.converter.schemas.enable: "false"
insert.mode: insert
transforms: dropPrefix
transforms.dropPrefix.type: org.apache.kafka.connect.transforms.RegexRouter
transforms.dropPrefix.regex: fake\.person\.json\.v0\.(.*)
transforms.dropPrefix.replacement: $1
table.name.format: dev
Message format:
{
“name”: {
“firstName”: “Kafka”,
“lastName”: “connect”
},
“age”: 1,
“birthDate”: {
“year”: 2021,
“month”: 11,
“day”: 26
},
“idNumber”: “000000”,
“gender”: “male”,
“address”: {
“streetAddress”: “apache”,
“streetNumber”: “1”,
“code”: “774432 61”,
“locality”: “confluent”,
“municipality”: {
“name”: “kafka”,
“code”: “2021”
},
“region”: {
“name”: “helloo”,
“code”: “2021”,
“letter”: “C”
}
},
“phoneNumber”: “00000000”,
“emailAddress”: “cesho@gmail.com”
}
Thanks,
Cesho