Skip to main content
DLC provides a default JdbcSourceDescription with the name defaultJdbcSourceDesc.

Configuration properties

Properties for a JDBC Source are defined by name in the dlc.jdbc.sources namespace, and are picked up as configurations for the DLC.
KeyRequiredTypeDescription
urlYStringURL for JDBC connection
usernameYStringUsername for JDBC connection
passwordYStringPassword for JDBC connection
driver-classYStringDriver class name for JDBC connection
topics-to-includeSet<String>Topics to include. See source to topic matching.
topics-to-excludeSet<String>Topics to exclude. See source to topic matching.
accepts-topic-overridesBooleanWhether this source is allowed to accept Topic Overrides in the Load Request.

YAML example

dlc:
  jdbc:
    sources:
      jdbcSource:
        url: jdbc:mysql://localhost:3306/mydb
        username: username
        password: password
        driver-class: org.postgresql.Driver
        topics-to-include:
          - topic1
          - topic2

Java configuration

JdbcSourceDescription Spring Beans are picked up as configurations for the DLC.
ParameterRequiredTypeDescription
nameYStringName of the source.
urlYStringURL for JDBC connection
usernameYStringUsername for JDBC connection
passwordYStringPassword for JDBC connection
driverClassYStringDriver class name for JDBC connection
topicsToIncludeSet<String>Topics to include. See source to topic matching.
topicsToExcludeSet<String>Topics to exclude. See source to topic matching.
acceptsTopicOverridesBooleanWhether this source is allowed to accept Topic Overrides in the Load Request.

Java example

@Bean
JdbcSourceDescription source() {
    return JdbcSourceDescription.builder(
                    "jdbcSource",
                    "jdbc:mysql://localhost:3306/mydb",
                    "username",
                    "password",
                    "org.postgresql.Driver")
            .topicsToInclude(Set.of("topic1", "topic2"))
            .build();
}