Is there a way to control the amount data that can be processed by a flux. Ex: Lets say I get millions of messages in a stream and I want to process this data. I want to be able to meter each of my k8s pods saying that I want to process 1000 messages a second, how can this be done in Flux? I have already tried limit rate and concurrency in flatmap but its not helping
Flux.fromIterable(a).limitRate(1000).publishOn(Schedulers.boundedElastic())
.flatMap(local -> {
System.out.println(System.currentTimeMillis() + ": time for : flatmap "+ local);
return Mono.just(local);
}, 1).subscribe();