use of io.debezium.config.Configuration in project debezium by debezium.
the class PostgresConnectorIT method shouldNotProduceEventsWithInitialOnlySnapshot.
@Test
public void shouldNotProduceEventsWithInitialOnlySnapshot() throws InterruptedException {
TestHelper.execute(SETUP_TABLES_STMT);
Configuration config = TestHelper.defaultConfig().with(PostgresConnectorConfig.SNAPSHOT_MODE, INITIAL_ONLY.getValue()).with(PostgresConnectorConfig.DROP_SLOT_ON_STOP, Boolean.TRUE).build();
start(PostgresConnector.class, config);
assertConnectorIsRunning();
// check the records from the snapshot
assertRecordsFromSnapshot(2, 1, 1);
// insert and verify that no events were received since the connector should not be streaming changes
TestHelper.execute(INSERT_STMT);
waitForAvailableRecords(100, TimeUnit.MILLISECONDS);
// there shouldn't be any records
assertNoRecordsToConsume();
}
use of io.debezium.config.Configuration in project debezium by debezium.
the class PostgresConnectorIT method shouldNotStartWithInvalidConfiguration.
@Test
public void shouldNotStartWithInvalidConfiguration() throws Exception {
// use an empty configuration which should be invalid because of the lack of DB connection details
Configuration config = Configuration.create().build();
// we expect the engine will log at least one error, so preface it ...
logger.info("Attempting to start the connector with an INVALID configuration, so MULTIPLE error messages & one exceptions will appear in the log");
start(PostgresConnector.class, config, (success, msg, error) -> {
assertThat(success).isFalse();
assertThat(error).isNotNull();
});
assertConnectorNotRunning();
}
use of io.debezium.config.Configuration in project debezium by debezium.
the class Configurator method createSchemas.
/**
* For tests use only
*/
public MySqlSchema createSchemas() {
Configuration config = configBuilder.build();
String serverName = config.getString(MySqlConnectorConfig.SERVER_NAME);
return new MySqlSchema(config, serverName, null, false, TopicSelector.defaultSelector(serverName, "__debezium-heartbeat"));
}
use of io.debezium.config.Configuration in project debezium by debezium.
the class MySqlConnectorIT method shouldValidateLockingModeWithMinimalLocksEnabledConfiguration.
/**
* Validates that if you use the deprecated snapshot.minimal.locking configuration value is set to true
* and its replacement snapshot.locking.mode is not explicitly defined, configuration validates as acceptable.
*/
@Test
@FixFor("DBZ-602")
public void shouldValidateLockingModeWithMinimalLocksEnabledConfiguration() {
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).build();
MySqlConnector connector = new MySqlConnector();
Config result = connector.validate(config.asMap());
assertNoConfigurationErrors(result, MySqlConnectorConfig.SNAPSHOT_LOCKING_MODE);
assertThat(new MySqlConnectorConfig(config).getSnapshotLockingMode()).isEqualTo(SnapshotLockingMode.MINIMAL);
}
use of io.debezium.config.Configuration in project debezium by debezium.
the class MongoClientsIT method beforeAll.
@BeforeClass
public static void beforeAll() {
Configuration config = TestHelper.getConfiguration();
String host = config.getString(MongoDbConnectorConfig.HOSTS);
addresses = MongoUtil.parseAddresses(host);
}
Aggregations