-
Bug
-
Resolution: Done
-
Major
-
1.1.0.Beta2
-
None
According to the documentation, if you supply a message.key.columns setting any unmatched tables are supposed to use their current primary key columns:
For any table without an explicit key configuration the table's primary key column(s) will be used as message key.
This is not currently happening, and if you match any table in message.key.columns then any non-matching tables have no message key at all.
We are currently using the following patch to rectify this behaviour.
--- debezium-core/src/main/java/io/debezium/relational/Key.java (revision 26cdc58efcf15e3d263dcf89bd4fff03b2cc7bf9) +++ debezium-core/src/main/java/io/debezium/relational/Key.java (date 1582503668926) @@ -118,13 +118,17 @@ Predicate<ColumnId> delegate = Predicates.includes(regexes, ColumnId::toString); return (table) -> { - return table.columns() + List<Column> columns = table.columns() .stream() .filter(c -> { final TableId tableId = table.id(); return delegate.test(new ColumnId(tableId.catalog(), tableId.schema(), tableId.table(), c.name())); }) .collect(Collectors.toList()); + if (columns.size() > 0) { + return columns; + } + return table.primaryKeyColumns(); }; } }