Kafka: Cant Create Multiple Stream Consumers

后端 未结 1 1988
梦如初夏
梦如初夏 2021-02-14 18:10

I just got up and running with Kafka 0.8 beta 1. I have a really simple example up and running, the problem is, I can only get one message consumer to work, not several. That

1条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-14 18:31

    Maybe too late for questioner but could be useful to other developers. Seems you have used only one Partition for couple of Consumers – that's wrong. Quote from Documentation:

    Since there are many partitions this still balances the load over many consumer instances. Note however that there cannot be more consumer instances than partitions.

    So when you think about Consumers you should think how to divide messages by partitions. In most cases you should use some high-level grouping to it or even let it be random by default.

    0 讨论(0)
提交回复
热议问题