Closed misterion closed 6 years ago
@misterion I think this might help to understand what ConsumerGroups are - https://blog.cloudera.com/blog/2018/05/scalability-of-kafka-messaging-using-consumer-groups/
TLDR: this idea is that you can launch multiple parallel consumers to consume a single topic and each consumer only consumes a subset of partitions. The maximum number of concurrent consumers must therefore be <= number of partitions and you can scale a topic horizontally by adding more partitions to it.
BTW, sarama-cluster is semi-deprecated, as I have been working on implementing the cluster feature directly into sarama - https://github.com/Shopify/sarama/pull/1099
Sorry for lame question here - i
m new to kafka and sarama — all my previous experiense was with AMQP and SNS. While testing groups in kafka with
kafka-consumer-groupsi
l see expected results — running some consumers over some producers with partition i see that messages passed to all consumers.Now try to get same results with sarama-cluster with this code:
And producer code
Now launching one procucers and some consumers the only one consumer got messages from producer. If shutdown this consumer one of other would receive messages but only one. Could you please help me with right documentation of samples may be to got that is wrong with this code?