英文:
Reactive Kafka and many partitions
问题
Kafka分区的数量对于Reactive Kafka接收器是否重要,或者效率是否与一个Kafka分区相同(因为响应式接收器无论如何都只使用一个线程)?
英文:
Does number of Kafka partitions matter for Reactive Kafka Receiver or the efficency is the same as with one Kafka partition (as the reactive receiver anyway uses one thread (if so))?
答案1
得分: 1
根据信息(1、2、3和4),每个 KafkaReceiver.receive
调用都会在底层创建一个单线程,该线程将执行基本的阻塞 KafkaConsumer.poll()
底层操作。因此,实际上,无论您使用响应式接收器还是原始的Kafka消费者API,您的问题都与基本的Kafka主题管理和配置有关。
有很多关于这方面的文章,这里是Confluent的一个示例。简而言之,通常多个分区会导致更高的性能,但在实际情况中,性能取决于您解决方案的瓶颈在哪里。
英文:
According to sources (1, 2, 3 and 4) each KafkaReceiver.receive
call would create single thread under the hood which would execute basic blocking KafkaConsumer.poll()
underneath. So it's actually doesn't matter so much whether do you use reactive receiver or raw Kafka consumer API, your question relates to basic Kafka topic management and configuration.
There are plenty articles on it, here is the Confluent's one for example. In a nutshell, usually multiple partitions leads to a higher performance, but in practice it depends on where is the bottleneck of your solution.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论