private void createOtherSchema(String otherSchemaName) { CustomDBCreator dbCreator = new CustomDBCreator(dataFile, dataSourceURL, driverClassName, eventuateConfigurationProperties.getDbUserName(), eventuateConfigurationProperties.getDbPassword()); dbCreator.create(sqlList -> { sqlList.set(0, sqlList.get(0).replace("create database", "create database if not exists")); for (int i = 0; i < 3; i++) sqlList.set(i, sqlList.get(i).replace("eventuate", otherSchemaName)); return sqlList; }); }
@Bean @Conditional(MySqlBinlogCondition.class) public DbLogClient<MessageWithDestination> mySqlBinaryLogClient(@Value("${spring.datasource.url}") String dataSourceURL, EventuateConfigurationProperties eventuateConfigurationProperties, SourceTableNameSupplier sourceTableNameSupplier, IWriteRowsEventDataParser<MessageWithDestination> eventDataParser, EventuateSchema eventuateSchema) { JdbcUrl jdbcUrl = JdbcUrlParser.parse(dataSourceURL); return new MySqlBinaryLogClient<>(eventDataParser, eventuateConfigurationProperties.getDbUserName(), eventuateConfigurationProperties.getDbPassword(), jdbcUrl.getHost(), jdbcUrl.getPort(), eventuateConfigurationProperties.getBinlogClientId(), ResolvedEventuateSchema.make(eventuateSchema, jdbcUrl), sourceTableNameSupplier.getSourceTableName(), eventuateConfigurationProperties.getMySqlBinLogClientName(), eventuateConfigurationProperties.getBinlogConnectionTimeoutInMilliseconds(), eventuateConfigurationProperties.getMaxAttemptsForBinlogConnection()); }
@Bean @Conditional(MySqlBinlogCondition.class) public DbLogClient<MessageWithDestination> mySqlBinaryLogClient(@Value("${spring.datasource.url}") String dataSourceURL, EventuateConfigurationProperties eventuateConfigurationProperties, SourceTableNameSupplier sourceTableNameSupplier, IWriteRowsEventDataParser<MessageWithDestination> eventDataParser, EventuateSchema eventuateSchema) { JdbcUrl jdbcUrl = JdbcUrlParser.parse(dataSourceURL); return new MySqlBinaryLogClient<>(eventDataParser, eventuateConfigurationProperties.getDbUserName(), eventuateConfigurationProperties.getDbPassword(), jdbcUrl.getHost(), jdbcUrl.getPort(), eventuateConfigurationProperties.getBinlogClientId(), ResolvedEventuateSchema.make(eventuateSchema, jdbcUrl), sourceTableNameSupplier.getSourceTableName(), eventuateConfigurationProperties.getMySqlBinLogClientName(), eventuateConfigurationProperties.getBinlogConnectionTimeoutInMilliseconds(), eventuateConfigurationProperties.getMaxAttemptsForBinlogConnection()); }
@Bean public DbLogClient<PublishedEvent> dbLogClient(@Value("${spring.datasource.url}") String dataSourceURL, EventuateConfigurationProperties eventuateConfigurationProperties, SourceTableNameSupplier sourceTableNameSupplier, IWriteRowsEventDataParser<PublishedEvent> eventDataParser, EventuateSchema eventuateSchema) { JdbcUrl jdbcUrl = JdbcUrlParser.parse(dataSourceURL); return new MySqlBinaryLogClient<>(eventDataParser, eventuateConfigurationProperties.getDbUserName(), eventuateConfigurationProperties.getDbPassword(), jdbcUrl.getHost(), jdbcUrl.getPort(), eventuateConfigurationProperties.getBinlogClientId(), ResolvedEventuateSchema.make(eventuateSchema, jdbcUrl), sourceTableNameSupplier.getSourceTableName(), eventuateConfigurationProperties.getMySqlBinLogClientName(), eventuateConfigurationProperties.getBinlogConnectionTimeoutInMilliseconds(), eventuateConfigurationProperties.getMaxAttemptsForBinlogConnection()); }
@Bean @Conditional(MySqlBinlogCondition.class) public MySqlBinaryLogClient<PublishedEvent> mySqlBinaryLogClient(@Value("${spring.datasource.url}") String dataSourceURL, EventuateConfigurationProperties eventuateConfigurationProperties, SourceTableNameSupplier sourceTableNameSupplier, IWriteRowsEventDataParser<PublishedEvent> eventDataParser, EventuateSchema eventuateSchema) { JdbcUrl jdbcUrl = JdbcUrlParser.parse(dataSourceURL); return new MySqlBinaryLogClient<>(eventDataParser, eventuateConfigurationProperties.getDbUserName(), eventuateConfigurationProperties.getDbPassword(), jdbcUrl.getHost(), jdbcUrl.getPort(), eventuateConfigurationProperties.getBinlogClientId(), ResolvedEventuateSchema.make(eventuateSchema, jdbcUrl), sourceTableNameSupplier.getSourceTableName(), eventuateConfigurationProperties.getMySqlBinLogClientName(), eventuateConfigurationProperties.getBinlogConnectionTimeoutInMilliseconds(), eventuateConfigurationProperties.getMaxAttemptsForBinlogConnection()); }
private MySqlBinaryLogClient<PublishedEvent> makeMySqlBinaryLogClient() { JdbcUrl jdbcUrl = JdbcUrlParser.parse(dataSourceURL); return new MySqlBinaryLogClient<>(eventDataParser, eventuateConfigurationProperties.getDbUserName(), eventuateConfigurationProperties.getDbPassword(), jdbcUrl.getHost(), jdbcUrl.getPort(), eventuateConfigurationProperties.getBinlogClientId(), ResolvedEventuateSchema.make(eventuateSchema, jdbcUrl), sourceTableNameSupplier.getSourceTableName(), eventuateConfigurationProperties.getMySqlBinLogClientName(), eventuateConfigurationProperties.getBinlogConnectionTimeoutInMilliseconds(), eventuateConfigurationProperties.getMaxAttemptsForBinlogConnection()); }
private MySqlBinaryLogClient<PublishedEvent> createMySqlBinaryLogClient() { JdbcUrl jdbcUrl = JdbcUrlParser.parse(dataSourceURL); return new MySqlBinaryLogClient<>(eventDataParser, eventuateConfigurationProperties.getDbUserName(), eventuateConfigurationProperties.getDbPassword(), jdbcUrl.getHost(), jdbcUrl.getPort(), eventuateConfigurationProperties.getBinlogClientId(), ResolvedEventuateSchema.make(eventuateSchema, jdbcUrl), sourceTableNameSupplier.getSourceTableName(), eventuateConfigurationProperties.getMySqlBinLogClientName(), eventuateConfigurationProperties.getBinlogConnectionTimeoutInMilliseconds(), eventuateConfigurationProperties.getMaxAttemptsForBinlogConnection()); }