We are trying to collect changes from a number of Postgresql databases using Debezium. The idea is to create a single topic with a number of partitions equal to the number of databases - each database gets its own partition, because order of events matters. We managed to reroute events to a single topic using topic routing, but to be able to partition events by databases I need to set message key properly.
Qestion: Is there a way we can set kafka message key to be equal to the source database name?
My thougts:
- Maybe there is a way to set message key globally per connector configuration?
- Database name can be found in the message, but its a nested property
payload.source.name. Didn't find a way to extract value from a nested propery.
Any thoughts?
Thank you in advance!