Hi.I`m sending nginx logs to kafka. Each nginx goes to one exclusive partition.I guarantee this by asigning to each nginx a number (1 to 22), and I usethat number for a custom partitoner's partition method as the key parameter: return Integer.parseInt(key) % partitions

I have 22 nginxs, so I have 22 partitions with data.The cluster has 5 brokers with ten partitions, so the total partitions forthe topic is 50.

In teory I could be able to start up to 22 consumers and each one should beable to consume from one partition.But what is happening is that I only can start three consumers:The first one consumes the ten partitions of the first broker.The second one consumes the ten partitions of the second broker.The third one consumes the remaining 2 partitions of the third broker.

Any other consumer that I start in the same consumer group, doesn`tconsumes anything, and the three consumers that are consuming are notbalanced.

I am using Kafka 0.7.1, with zookeeper and the java consumer connector,with the zk.connect property.

> Hi.> I`m sending nginx logs to kafka. Each nginx goes to one exclusive> partition.> I guarantee this by asigning to each nginx a number (1 to 22), and I use> that number for a custom partitoner's partition method as the key> parameter:> return Integer.parseInt(key) % partitions>> I have 22 nginxs, so I have 22 partitions with data.> The cluster has 5 brokers with ten partitions, so the total partitions for> the topic is 50.>> In teory I could be able to start up to 22 consumers and each one should be> able to consume from one partition.> But what is happening is that I only can start three consumers:> The first one consumes the ten partitions of the first broker.> The second one consumes the ten partitions of the second broker.> The third one consumes the remaining 2 partitions of the third broker.>> Any other consumer that I start in the same consumer group, doesn`t> consumes anything, and the three consumers that are consuming are not> balanced.>> I am using Kafka 0.7.1, with zookeeper and the java consumer connector,> with the zk.connect property.>> What could it be happening?>> Thanks for the help!>> --> Javier Iseruk> Architecture Team> Phone: +5411-4640-8063>

Thanks for the answer. I send you the info:I am ommiting all the files in each directory, just leaves one for showingthe structure.There are two topics: access_log@nginx-nginx-api-master andaccess_log@nginx-nginx-api-v1.The consumer uses a whitelist with the regex access_log@nginx-nginx-api-.*,so both topis are consumed I don't see any problem with the topics names.

Hi again!I have more info to share.What I'm seeing in zookeeper is that the consumers are owning almost thesame partitions quantity, no matter if that partition has data or not. Sofor example:Consumer 1: 17 partitions (all with data)Consumer 2: 17 partitions (only five with data)Consumer 3: 16 partitions (no data at all)

That is is the photo I'm seeing now.

I would expect that the consumers own the same not empty partitionsquantity. I don`t care about the empty partitions, but apparently, Kafkadivides the partitions no matter if it`s an empty partition or not.So I would like to see something like this:Consumer 1: 17 partitions (7 with data)Consumer 2: 17 partitions (7 with data)Consumer 3: 16 partitions (8 data at all)

Or if I add another consumer, the result expected would be something likethis:Consumer 1: 13 partitions (5 with data)Consumer 2: 13 partitions (5 with data)Consumer 3: 12 partitions (6 data at all)Consumer 4: 12 partitions (6 data at all)

I'm not sure if this relates directly to your problem, but you are usingnon-standard topic names because of the @ character. Topic names shouldonly include alphanumeric plus hyphen and underscore. Have you checked yourlogs for any errors because of processing these topic names?