如何使用 `Function<Flux<String>, Flux<String>>` 增加主题消费者吞吐量?

How to increase the topic consumer throughput by using `Function<Flux<String>, Flux<String>>`?

我有一个基于 webFlux 的服务,它将使用然后从 kafka 主题生成消息。 我的代码是这样的

@Bean
public Function<Flux<String>, Flux<String>> reactiveUpperCase() {
    return flux -> flux.map(val -> val.toUpperCase());
}

我发现当我有 2 个实例时,我可以每 30 分钟消耗 750 条消息,但我的 CPU 永远不会高于 10%。 随着时间的推移,延迟不断增加,所以我想知道如何增加消费者吞吐量。 从文档来看,并发对reactive不生效,link

有谁知道如何在不添加更多实例的情况下提高吞吐量?

当我使用 kotlin 时,我发现使用的是 Flow.flatMapMerge(parallelCount)