THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- Consumer
c
subscribes to topict
with one partitionp
. - Consumer
c
consumes some messages fromp
. - Consumer
c
unsubscribes fromt
. - Partition
p
is marked for removal during the next rebalance. - During the next rebalance, the offset of
c
's assigned partitions (includingp
) is committed, and then updated (resulting inp
's removal).
Code Block |
---|
consumer.subscribe(Arrays.asList("foo", "bar"))
System.out.println(consumer.assignment()); // prints []
consumer.poll(0)
--> onPartitionsRevoked([])
--> onPartitionsAssigned([(foo, 0), (bar,0)])
System.out.println(consumer.assignment()); // prints [(foo, 0), (bar, 0)]
consumer.subscribe(Arrays.asList("foo"))
System.out.println(consumer.assignment()); // prints [(foo, 0), (bar, 0)]
consumer.poll(0)
--> onPartitionsRevoked([(foo, 0), (bar, 0)])
--> onPartitionsAssigned([(foo, 0)])
System.out.println(consumer.assignment()); // prints [(foo, 0)] |
Public Interfaces
There are no new public interfaces or changes to existing interfaces suggested by this KIP.
...