JDBC Source
note
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-name | Y | String |
Driver class name for JDBC connection |
| topics-to-include | Set<String> |
Topics to include. | |
| topics-to-exclude | Set<String> |
Topics to exclude. | |
| accepts-topic-overrides | Boolean |
Whether this source is allowed to accept Topic Overrides in the DLC Load Request. |
YAML Example
dlc:
jdbc:
sources:
jdbcSource:
url: jdbc:mysql://localhost:3306/mydb
username: username
password: password
driver-class-name: 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 |
| driverClassName | Y | String |
Driver class name for JDBC connection |
| topicsToInclude | Set<String> |
Topics to include. | |
| topicsToExclude | Set<String> |
Topics to exclude. | |
| acceptsTopicOverrides | Boolean |
Whether this source is allowed to accept Topic Overrides in the DLC 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();
}