Hello everyone,
Recently, while investigation the UnAckedMessageTracker, I noticed that when user calls the consumer.acknowledgeCumulative() method, it iterates through all the elements in the UnAckedMessageTracker.messageIdPartitionMap. When there are many elements in the map, the performance might be poor.
I plan to change the data structure of UnAckedMessageTracker.messageIdPartitionMap from a HashMap to an Object2ObjectSortedMap, and make this configurable when the consumer type is Exclusive. This way, when consumer.acknowledgeCumulative() is called, it wonโt be necessary to iterate through all the elements in UnAckedMessageTracker.messageIdPartitionMap, which could significantly improve performance.
However, this change would also make the UnAckedMessageTracker.add() method slightly slower than before.
Before I proceed with this implementation, Iโd like to hear your thoughts and suggestions.
Thanks!