You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by David Luu <ma...@gmail.com> on 2015/10/12 22:07:44 UTC

Consume messages from offset A to B with the kafka shell scripts, etc.? And get total messages given starting and ending offset?

Hi,

Similar to consuming max messages N (or count of messages N in kafkacat),
is there any way/option to consume starting from offset A up to ending
offset B (we know only offsets but not the total # of messages between
those offsets)

It looks like that's not available natively? And I guess one would have to
write script to run the consumption from starting offset A to continuously
consume, printing out the offsets while consuming and in the script check
offset and stop the script execution when current offset >= offset B?

On a related note, is there a way to query for total # messages given a
starting and ending offset value? Then one could use the shell scripts or
kafkacat and simply use the max message / count with starting offset.

Thanks,
David