use of io.debezium.config.Configuration in project debezium by debezium.
the class MySqlConnectorIT method shouldFailToValidateConflictingLockingModeExtendedConfiguration.
/**
* Validates that if you use the deprecated snapshot.minimal.locking configuration value
* AND set its replacement snapshot.locking.mode an error will be generated.
*/
@Test
@FixFor("DBZ-602")
public void shouldFailToValidateConflictingLockingModeExtendedConfiguration() {
Configuration config = DATABASE.defaultJdbcConfigBuilder().with(MySqlConnectorConfig.SSL_MODE, SecureConnectionMode.DISABLED).with(MySqlConnectorConfig.SERVER_ID, 18765).with(MySqlConnectorConfig.SERVER_NAME, "myServer").with(KafkaDatabaseHistory.BOOTSTRAP_SERVERS, "some.host.com").with(KafkaDatabaseHistory.TOPIC, "my.db.history.topic").with(MySqlConnectorConfig.INCLUDE_SCHEMA_CHANGES, true).with(MySqlConnectorConfig.SNAPSHOT_MINIMAL_LOCKING, true).with(MySqlConnectorConfig.SNAPSHOT_LOCKING_MODE, "extended").build();
MySqlConnector connector = new MySqlConnector();
Config result = connector.validate(config.asMap());
assertConfigurationErrors(result, MySqlConnectorConfig.SNAPSHOT_LOCKING_MODE);
}
use of io.debezium.config.Configuration in project debezium by debezium.
the class MySqlConnectorIT method shouldFailToValidateConflictingLockingModeNoneConfiguration.
/**
* Validates that if you use the deprecated snapshot.minimal.locking configuration value
* AND set its replacement snapshot.locking.mode an error will be generated.
*/
@Test
@FixFor("DBZ-602")
public void shouldFailToValidateConflictingLockingModeNoneConfiguration() {
Configuration config = DATABASE.defaultJdbcConfigBuilder().with(MySqlConnectorConfig.SSL_MODE, SecureConnectionMode.DISABLED).with(MySqlConnectorConfig.SERVER_ID, 18765).with(MySqlConnectorConfig.SERVER_NAME, "myServer").with(KafkaDatabaseHistory.BOOTSTRAP_SERVERS, "some.host.com").with(KafkaDatabaseHistory.TOPIC, "my.db.history.topic").with(MySqlConnectorConfig.INCLUDE_SCHEMA_CHANGES, true).with(MySqlConnectorConfig.SNAPSHOT_MINIMAL_LOCKING, true).with(MySqlConnectorConfig.SNAPSHOT_LOCKING_MODE, "none").build();
MySqlConnector connector = new MySqlConnector();
Config result = connector.validate(config.asMap());
assertConfigurationErrors(result, MySqlConnectorConfig.SNAPSHOT_LOCKING_MODE);
}
use of io.debezium.config.Configuration in project debezium by debezium.
the class MySqlConnectorIT method shouldValidateAcceptableConfiguration.
@Test
public void shouldValidateAcceptableConfiguration() {
Configuration config = DATABASE.defaultJdbcConfigBuilder().with(MySqlConnectorConfig.SSL_MODE, SecureConnectionMode.DISABLED).with(MySqlConnectorConfig.SERVER_ID, 18765).with(MySqlConnectorConfig.SERVER_NAME, "myServer").with(KafkaDatabaseHistory.BOOTSTRAP_SERVERS, "some.host.com").with(KafkaDatabaseHistory.TOPIC, "my.db.history.topic").with(MySqlConnectorConfig.INCLUDE_SCHEMA_CHANGES, true).build();
MySqlConnector connector = new MySqlConnector();
Config result = connector.validate(config.asMap());
assertNoConfigurationErrors(result, MySqlConnectorConfig.HOSTNAME);
assertNoConfigurationErrors(result, MySqlConnectorConfig.PORT);
assertNoConfigurationErrors(result, MySqlConnectorConfig.USER);
assertNoConfigurationErrors(result, MySqlConnectorConfig.PASSWORD);
assertNoConfigurationErrors(result, MySqlConnectorConfig.SERVER_NAME);
assertNoConfigurationErrors(result, MySqlConnectorConfig.SERVER_ID);
assertNoConfigurationErrors(result, MySqlConnectorConfig.TABLES_IGNORE_BUILTIN);
assertNoConfigurationErrors(result, MySqlConnectorConfig.DATABASE_WHITELIST);
assertNoConfigurationErrors(result, MySqlConnectorConfig.DATABASE_BLACKLIST);
assertNoConfigurationErrors(result, MySqlConnectorConfig.TABLE_WHITELIST);
assertNoConfigurationErrors(result, MySqlConnectorConfig.TABLE_BLACKLIST);
assertNoConfigurationErrors(result, MySqlConnectorConfig.COLUMN_BLACKLIST);
assertNoConfigurationErrors(result, MySqlConnectorConfig.CONNECTION_TIMEOUT_MS);
assertNoConfigurationErrors(result, MySqlConnectorConfig.KEEP_ALIVE);
assertNoConfigurationErrors(result, MySqlConnectorConfig.KEEP_ALIVE_INTERVAL_MS);
assertNoConfigurationErrors(result, MySqlConnectorConfig.MAX_QUEUE_SIZE);
assertNoConfigurationErrors(result, MySqlConnectorConfig.MAX_BATCH_SIZE);
assertNoConfigurationErrors(result, MySqlConnectorConfig.POLL_INTERVAL_MS);
assertNoConfigurationErrors(result, MySqlConnectorConfig.DATABASE_HISTORY);
assertNoConfigurationErrors(result, MySqlConnectorConfig.INCLUDE_SCHEMA_CHANGES);
assertNoConfigurationErrors(result, MySqlConnectorConfig.SNAPSHOT_MODE);
assertNoConfigurationErrors(result, MySqlConnectorConfig.SNAPSHOT_LOCKING_MODE);
assertNoConfigurationErrors(result, MySqlConnectorConfig.SSL_MODE);
assertNoConfigurationErrors(result, MySqlConnectorConfig.SSL_KEYSTORE);
assertNoConfigurationErrors(result, MySqlConnectorConfig.SSL_KEYSTORE_PASSWORD);
assertNoConfigurationErrors(result, MySqlConnectorConfig.SSL_TRUSTSTORE);
assertNoConfigurationErrors(result, MySqlConnectorConfig.SSL_TRUSTSTORE_PASSWORD);
assertNoConfigurationErrors(result, MySqlConnectorConfig.DECIMAL_HANDLING_MODE);
assertNoConfigurationErrors(result, MySqlConnectorConfig.TIME_PRECISION_MODE);
assertNoConfigurationErrors(result, KafkaDatabaseHistory.BOOTSTRAP_SERVERS);
assertNoConfigurationErrors(result, KafkaDatabaseHistory.TOPIC);
assertNoConfigurationErrors(result, KafkaDatabaseHistory.RECOVERY_POLL_ATTEMPTS);
assertNoConfigurationErrors(result, KafkaDatabaseHistory.RECOVERY_POLL_INTERVAL_MS);
}
use of io.debezium.config.Configuration in project debezium by debezium.
the class MySqlConnectorIT method shouldFailToValidateConflictingLockingModeConfiguration.
/**
* Validates that if you use the deprecated snapshot.minimal.locking configuration value
* AND set its replacement snapshot.locking.mode an error will be generated.
*/
@Test
@FixFor("DBZ-602")
public void shouldFailToValidateConflictingLockingModeConfiguration() {
Configuration config = DATABASE.defaultJdbcConfigBuilder().with(MySqlConnectorConfig.SSL_MODE, SecureConnectionMode.DISABLED).with(MySqlConnectorConfig.SERVER_ID, 18765).with(MySqlConnectorConfig.SERVER_NAME, "myServer").with(KafkaDatabaseHistory.BOOTSTRAP_SERVERS, "some.host.com").with(KafkaDatabaseHistory.TOPIC, "my.db.history.topic").with(MySqlConnectorConfig.INCLUDE_SCHEMA_CHANGES, true).with(MySqlConnectorConfig.SNAPSHOT_MINIMAL_LOCKING, false).with(MySqlConnectorConfig.SNAPSHOT_LOCKING_MODE, "none").build();
MySqlConnector connector = new MySqlConnector();
Config result = connector.validate(config.asMap());
assertConfigurationErrors(result, MySqlConnectorConfig.SNAPSHOT_LOCKING_MODE);
}
use of io.debezium.config.Configuration in project debezium by debezium.
the class MySqlConnectorIT method shouldValidateLockingModeNoneWithValidSnapshotModeConfiguration.
/**
* Validates that SNAPSHOT_LOCKING_MODE 'none' is valid with all snapshot modes
*/
@Test
@FixFor("DBZ-639")
public void shouldValidateLockingModeNoneWithValidSnapshotModeConfiguration() {
final List<String> acceptableValues = Arrays.stream(SnapshotMode.values()).map(SnapshotMode::getValue).collect(Collectors.toList());
// Loop over all known valid values
for (final String acceptableValue : acceptableValues) {
Configuration config = DATABASE.defaultJdbcConfigBuilder().with(MySqlConnectorConfig.SSL_MODE, SecureConnectionMode.DISABLED).with(MySqlConnectorConfig.SERVER_ID, 18765).with(MySqlConnectorConfig.SERVER_NAME, "myServer").with(KafkaDatabaseHistory.BOOTSTRAP_SERVERS, "some.host.com").with(KafkaDatabaseHistory.TOPIC, "my.db.history.topic").with(MySqlConnectorConfig.INCLUDE_SCHEMA_CHANGES, true).with(MySqlConnectorConfig.SNAPSHOT_LOCKING_MODE, SnapshotLockingMode.NONE.getValue()).with(MySqlConnectorConfig.SNAPSHOT_MODE, acceptableValue).build();
MySqlConnector connector = new MySqlConnector();
Config result = connector.validate(config.asMap());
assertNoConfigurationErrors(result, MySqlConnectorConfig.SNAPSHOT_LOCKING_MODE);
assertThat(new MySqlConnectorConfig(config).getSnapshotLockingMode()).isEqualTo(SnapshotLockingMode.NONE);
}
}
Aggregations