we have one consumer that consume data from kafka with 5 partitions. the consumer have 5 groupid's.
we noticed that each groupid consume messages from only one partition. in the code we Subscribe to the topic using consumer.subscribe.
as we understand with one consumer each groupid need to consume messages from all partitions.
are we wrong in our assumption? if not what causes the problem?
private void subscribe() {
consumer.subscribe( Collections.singletonList( topic ) );
} catch ( IllegalArgumentException e ){
LOG.error( "Kafka Failed to subscribe to kafka client ", e );
e.printStackTrace();
} catch( IllegalStateException e ){
LOG.error( "Kafka Failed to subscribe to kafka client ", e );
e.printStackTrace();
} catch ( Exception e ){
LOG.error( "Kafka Failed to subscribe to kafka client, topic: " + topic , e );
}
}