Skip to content

Commit e79a6be

Browse files
tkaymakclaude
andcommitted
Wire DebeziumSDFDatabaseHistory default to schema.history.internal
The default schema history implementation was registered under the pre-Debezium-2.0 key database.history, which Debezium 3.x ignores. As a result DebeziumSDFDatabaseHistory was unreachable unless users set schema.history.internal explicitly and historized connectors silently fell back to KafkaSchemaHistory pointing at localhost:9092. Registering the default under schema.history.internal makes the Beam native history implementation the default again as originally intended. Users who set schema.history.internal themselves are unaffected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 3331ba5 commit e79a6be

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

sdks/java/io/debezium/src/main/java/org/apache/beam/io/debezium/DebeziumIO.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
* .withConnectorClass(MySqlConnector.class)
7575
* .withConnectionProperty("database.server.id", "184054")
7676
* .withConnectionProperty("database.server.name", "serverid")
77-
* .withConnectionProperty("database.history", DebeziumSDFDatabaseHistory.class.getName())
77+
* .withConnectionProperty("schema.history.internal", DebeziumSDFDatabaseHistory.class.getName())
7878
* .withConnectionProperty("include.schema.changes", "false");
7979
*
8080
* PipelineOptions options = PipelineOptionsFactory.create();
@@ -640,10 +640,10 @@ public Map<String, String> getConfigurationMap() {
640640
configuration.computeIfAbsent(entry.getKey(), k -> entry.getValue());
641641
}
642642

643-
// Set default Database History impl. if not provided implementation and Kafka topic prefix,
644-
// if not provided
643+
// Set default schema history impl. if not provided implementation and Kafka topic prefix,
644+
// if not provided. Before Debezium 2.0 this key was named "database.history".
645645
configuration.computeIfAbsent(
646-
"database.history",
646+
"schema.history.internal",
647647
k -> KafkaSourceConsumerFn.DebeziumSDFDatabaseHistory.class.getName());
648648
configuration.computeIfAbsent("topic.prefix", k -> "beam-debezium-connector");
649649
configuration.computeIfAbsent(

sdks/java/io/debezium/src/test/java/org/apache/beam/io/debezium/DebeziumIOTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public class DebeziumIOTest implements Serializable {
5252
.withConnectionProperty("database.server.id", "184054")
5353
.withConnectionProperty("database.server.name", "dbserver1")
5454
.withConnectionProperty(
55-
"database.history", KafkaSourceConsumerFn.DebeziumSDFDatabaseHistory.class.getName())
55+
"schema.history.internal",
56+
KafkaSourceConsumerFn.DebeziumSDFDatabaseHistory.class.getName())
5657
.withConnectionProperty("include.schema.changes", "false");
5758

5859
@Test

0 commit comments

Comments
 (0)