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.
| Key | Required | Type | Description |
|---|
| url | Y | String | URL for JDBC connection |
| username | Y | String | Username for JDBC connection |
| password | Y | String | Password for JDBC connection |
| driver-class | Y | String | Driver class name for JDBC connection |
| topics-to-include | | Set<String> | Topics to include. See source to topic matching. |
| topics-to-exclude | | Set<String> | Topics to exclude. See source to topic matching. |
| accepts-topic-overrides | | Boolean | Whether 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.
| Parameter | Required | Type | Description |
|---|
| name | Y | String | Name of the source. |
| url | Y | String | URL for JDBC connection |
| username | Y | String | Username for JDBC connection |
| password | Y | String | Password for JDBC connection |
| driverClass | Y | String | Driver class name for JDBC connection |
| topicsToInclude | | Set<String> | Topics to include. See source to topic matching. |
| topicsToExclude | | Set<String> | Topics to exclude. See source to topic matching. |
| acceptsTopicOverrides | | Boolean | Whether 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();
}