Ensuring that all messages have been read from Kafka topic using REST Proxy
If you would like to find the end partitions of a consumer group, in order to know when you've gotten all data at a point in time, you can use
POST /consumers/(string: group_name)/instances/(string: instance)/positions/end
Note that you must do a poll (GET /consumers/.../records
) before that seek, but you don't need to commit.
If you don't want to affect the offsets of your existing consumer group, you would have to post a separate one.
You can then query offsets with
GET /consumers/(string: group_name)/instances/(string: instance)/offsets
Note that there might be data being written to the topic between calculating the end offsets and actually reaching the end, so you might want to have some additional settings to do a few more consumptions once you finally do reach the end.