0

I am using Confluent Oracle CDC to write a source connector.
We have an old DB with no primary keys.
I can get the key from the message and put it in as the message key for Kafka. This works fine for inserts and updates.
But when I use emit.tombstone.on.delete=true to handle the deletes it does not work of course, because the message is null.

So what would be a good approach to solve this problem?

The sink connector expects a tombstone record to perform the delete on a SQL Server database.

I tried to set the value of the message to null after I extracted the key from the message but, I can't get it to work. Also not sure if this is the right approach.

greybeard
  • 2,249
  • 8
  • 30
  • 66
Chris
  • 1
  • 1
  • What Oracle version are you using? If you can logically define a unique key from the other columns, and are able to create a view on top of the table, you can add a constraint to the view and use the view instead of the table. – oisene Jun 06 '23 at 18:01
  • I will try that. Thanks for this suggestion. :-) – Chris Jun 07 '23 at 06:24
  • Now that I think about it, can the sink connector work with views? – Chris Jun 07 '23 at 12:11
  • It should, but I haven't tried it for a long while. It probably runs just a select anyway. – oisene Jun 08 '23 at 14:47
  • Finally figured it out. So for anyone with the same problem, this fixed it for me. On the oracle source connector I used: key.template=${rowId} emit.tombstone.on.delete=true On the sqlserver sink connector I used: pk.mode=record_key delete.enabled=true – Chris Jun 17 '23 at 20:31

0 Answers0