Skip to content

[feat][io] Add Debezium MariaDB source connector#69

Merged
david-streamlio merged 1 commit into
apache:masterfrom
david-streamlio:feat/debezium-mariadb-source
Jul 9, 2026
Merged

[feat][io] Add Debezium MariaDB source connector#69
david-streamlio merged 1 commit into
apache:masterfrom
david-streamlio:feat/debezium-mariadb-source

Conversation

@david-streamlio

Copy link
Copy Markdown
Contributor

Fixes #65

Motivation

Debezium ships a MariaDB source connector (io.debezium:debezium-connector-mariadb, present in the debezium-bom at our pinned version), but this repository did not wrap it. We wrapped 5 of Debezium's 12 source connectors; MariaDB was the most valuable gap:

  • Debezium split the MariaDB connector out of the MySQL connector, and both now build on the shared debezium-connector-binlog base — so the existing debezium/mysql module is a near drop-in template.
  • We already ship a MariaDB JDBC sink (integration test added in [improve][test] Add MariaDB JDBC sink integration test #59), so this completes the story for that database.

Modifications

New debezium/mariadb module (pulsar-io-debezium-mariadb), mirroring debezium/mysql:

  • DebeziumMariaDbSource extending DebeziumSource, pinning Debezium's MariaDbConnector / MariaDbConnectorTask
  • Service descriptor (META-INF/services/pulsar-io.yaml) and sample source config
  • Version catalog entry, settings.gradle.kts include, and wiring into distribution/io, docker/pulsar-all, the assembly XML, and docs

Test suite

Unit tests (DebeziumMariaDbSourceConfigTest, 7 cases, no database required) cover the connector/task class contract, which is otherwise a silent misconfiguration that only surfaces at runtime:

  • both keys are defaulted when absent, and accepted when explicitly set to the matching value
  • a mismatched connector or task class is rejected — specifically guarding against pointing the MariaDB source at the MySQL connector, an easy mistake now that the two share a binlog base
  • both class names resolve via Class.forName, proving the string literals name real classes on the runtime classpath

Integration test (DebeziumMariaDbSourceTest) runs the source against a real mariadb:11.4 server plus a PulsarContainer for Debezium's schema history, seeds two rows, and asserts the initial snapshot emits CDC records.

Verifying this change

DebeziumMariaDbSourceConfigTest > 7 tests PASSED
DebeziumMariaDbSourceTest > testMariaDbCdcEvents PASSED
BUILD SUCCESSFUL in 24s

NAR packaging verified: pulsar-io-debezium-mariadb-4.3.0-SNAPSHOT.nar builds.

Notes

Debezium ships a MariaDB source connector but this repository did not
wrap it. Add pulsar-io-debezium-mariadb, following the structure of the
existing MySQL module: both connectors build on Debezium's shared
binlog base.

Includes a unit suite covering the connector/task class defaulting and
validation, and a Testcontainers integration test that runs the source
against a real MariaDB server and asserts the initial snapshot produces
CDC records.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Debezium-based MariaDB source connector module to the Pulsar connectors repository, mirroring the existing Debezium MySQL module and wiring it into build/distribution artifacts.

Changes:

  • Introduces debezium/mariadb (pulsar-io-debezium-mariadb) with DebeziumMariaDbSource, service descriptor, and sample config.
  • Adds unit tests validating connector/task class defaulting and mismatch rejection, plus an end-to-end Testcontainers integration test against mariadb:11.4.
  • Wires the new NAR into Gradle settings, version catalog, docs, docker image build, and distribution assembly.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
settings.gradle.kts Includes the new debezium:pulsar-io-debezium-mariadb subproject.
gradle/libs.versions.toml Adds the Debezium MariaDB connector artifact to the version catalog.
docs/build.gradle.kts Ensures docs aggregation includes the new Debezium MariaDB module.
docker/pulsar-all/build.gradle.kts Includes the MariaDB Debezium NAR in the “pulsar-all” connector set.
distribution/io/src/assemble/io.xml Adds the MariaDB Debezium NAR to the IO distribution assembly list.
distribution/io/build.gradle.kts Includes the MariaDB Debezium NAR in the IO distribution dependencies.
debezium/mariadb/build.gradle.kts Defines the new module’s build, dependencies, and test dependencies.
debezium/mariadb/src/main/java/org/apache/pulsar/io/debezium/mariadb/DebeziumMariaDbSource.java Implements the MariaDB Debezium Source wrapper by pinning connector/task classes.
debezium/mariadb/src/main/java/org/apache/pulsar/io/debezium/mariadb/package-info.java Adds package metadata for the new module.
debezium/mariadb/src/main/resources/META-INF/services/pulsar-io.yaml Registers the connector for discovery via Pulsar IO service loading.
debezium/mariadb/src/main/resources/debezium-mariadb-source-config.yaml Provides a sample YAML config for running the MariaDB source.
debezium/mariadb/src/test/java/org/apache/pulsar/io/debezium/mariadb/DebeziumMariaDbSourceConfigTest.java Unit tests validating connector/task class defaulting and validation.
debezium/mariadb/src/test/java/org/apache/pulsar/io/debezium/mariadb/DebeziumMariaDbSourceTest.java Integration test exercising snapshot CDC against a real MariaDB container + Pulsar schema history.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@david-streamlio
david-streamlio merged commit 3ee99c4 into apache:master Jul 9, 2026
2 checks passed
david-streamlio added a commit that referenced this pull request Jul 9, 2026
…ble (#72)

The connector was added in #69 but the README's Sources table was not
updated in the merged commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat][io] Add Debezium MariaDB source connector

2 participants