0

kafka rest proxy specify the numbers of records you want to get.

GET /consumers/(string:group_name)/instances/(string:instance)/records

Fetch data for the topics or partitions specified using one of the subscribe/assign APIs.

This api is used to fetch records from topic. Is there a convenient paramter to get specify the numbers of records I want to get.

For example, I want to get 10 records from a certain offset.
This api only have two query parameters, timeout and max_bytes. There is no parameter like limit_num.

POST /consumers/(string:group_name)/instances/(string:instance)/positions

Overrides the fetch offsets that the consumer will use for the next set of records to fetch.

I can use this api to set up the starting offset I want to get.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
niaomingjian
  • 3,472
  • 8
  • 43
  • 78

1 Answers1

0

There isn't.

You'd have to consume more than needed, then commit back a lower offset value than the number of records you did consume

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245