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:
abilan
2022-11-15 11:50:06 -05:00
parent 220b03b9aa
commit 1318cbde93

View File

@@ -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;