Description
I have a queue consist of 4 partitions, containing [49, 44, 30, 29] total : 152 messages.
Then i use SimpleComsumer connect to it, use peeding() to get messge num, test seek().
Here is my test code & result:
consumer = SimpleConsumer(kafka, "my-group", "my-replicated-topic", auto_commit=False)
print(consumer.pending()) #orgin result is 152
consumer.seek(0, 0)
print(consumer.pending()) #after seek 0 result is 152, correct
consumer.seek(1, 0)
print(consumer.pending()) #after seek 1 result is 150, should be 151
consumer.seek(10, 0)
print(consumer.pending()) #after seek 10 result is 138, shold be 142
consumer.seek(50, 0)
print(consumer.pending()) #after seek 50 result is 98, shold be 102
consumer.seek(100, 0)
print(consumer.pending()) #after seek 100 result is 48, shold be 52