Fix Cassandra init script execution
The script file may have several DDL expression to execute. They probably have to be called one-by-one as they are declared. For example our `init-db.cql` has DDL to delete table and the next to create. * Fix `CassandraAppClusterConfiguration.keyspaceInitializer()` to use a `Flux.concatMap()` instead of `flatMap()` to ensure sequential items processing in the order they appear upstream
This commit is contained in:
@@ -123,7 +123,7 @@ public class CassandraAppClusterConfiguration {
|
||||
|
||||
Flux.fromArray(StringUtils.delimitedListToStringArray(scripts, ";", "\r\n\f"))
|
||||
.filter(StringUtils::hasText) // an empty String after the last ';'
|
||||
.flatMap(script -> reactiveCqlOperations.execute(script + ";"))
|
||||
.concatMap(script -> reactiveCqlOperations.execute(script + ";"))
|
||||
.blockLast();
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user