'Spring data reactive cassandra: limit concurrent threads
I want to limit concurrent threads when some operation in cassandra is being performed. It could be limited with direct use of cassandraTemplate
like this:
public void insert(List<MyEntity> entities, int maxConcurrentThreadsAllowed) {
Flux.fromIterable(entities)
.flatMap(this::insert, maxConcurrentThreadsAllowed)
.subscribe();
}
public Mono<MyEntity> insert(MyEntity e) {
return cassandraTemplate.insert(e);
}
Is it possible to achieve the same using reactive repositories? Some kind of configuration on cassandraSession
level?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|