I'm working with a Kafka Consumer, and only subscribe to one topic. I want to return only the assigned partitions from the topic for each consumer. I am running four instances of the consumer in the same group, and reading a topic with 8 partitions.
I know I can use the assignment() method, but it looks like that returns the topic name and partition in the format of - (i.e. topic1-0, topic1-1, etc). Is there a better way of getting the partition only without having to parse the value returned from the assignment() method?