I was looking at Debezium documentation: https://debezium.io/documentation/reference/configuration/topic-routing.html
I can only see how to specify custom keys, but I cannot understand if by default it is using the DB primary key as routing key.
The DB primary key could even be a triplet like (column1, column2. column3)
Yes, it is possible by using message.key.columns
Sample:
{
"name": "my-connector",
"config": {
"...": "...",
"message.key.columns": "my_database.users:department_id"
}
}
Documentation: https://debezium.io/documentation/reference/connectors/postgresql.html#postgresql-property-message-key-columns.