-
I am testing out the Consumers Rest API and I have a hard time getting the result I was looking for. It might be my fault or a bug, not sure. ReproductionI am running redpanda in a single cluster installation in the same docker-compose with pandaproxy. I am testing the three following endpoints:
I add In the first and third request I send the following body as well:
IssuesFirstly, all consumer endpoinds ask for instance.id, and I had a really hard time finding what my
With
And with
Use caseI am using kafka to build data pipelines, and sometimes I want the consumer to re-consume a topic from the beginning (for ex. if I made a change in the pipeline, or there was an error in the consumer). I was searching for a way to manually reset/change the offset of a consumer group for a particular topic so that it re-consumes part of / all past events. This scenario is also typical in event-driven programming, where re-consuming past events is a recurring use case. To circumvent these issues, I created a temporary consumer for my pipeline until it re-consumed everything. It works, but it's not ideal. Feedback:
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
thanks for the report @nikosgpet ! |
Beta Was this translation helpful? Give feedback.
-
Thanks for the feedback @nikosgpet Are you trying to manage offsets for arbitrary consumers? Pandaproxy isn't a generalised admin tool for offset management, it only allows management of offsets for consumers that are created with it. When a consumer is created, you can specify a name, or one will be generated and returned, along with the endpoint to connect tp: https://vectorized.io/blog/pandaproxy/#Create-a-consumer Those are both required, because the rest proxy is stateful, storing various offsets, subscriptions, and partition assignments in the particular instance of Pandaproxy that the consumer instance was created on. For many If I've misunderstood, and you're having problems with consumers created on the proxy, then I'll take another look tomorrow, to make sure everything is working as expected. |
Beta Was this translation helpful? Give feedback.
-
@BenPope thanks for the detailed answer! I hadn't realized that the rest proxy allows only the manipulation of those consumers created by the proxy itself. This makes more sense now. What way would you currently recommend to manage offsets in a generalized way, for arbitrary consumers? I find that offset management would make a neat feature for the rpk. |
Beta Was this translation helpful? Give feedback.
-
@nikosgpet I don't have any concrete suggestions. I'm not sure there's a general way to do it, I think you'd have to shutdown the consumers, then commit offsets, and start the consumers up again. Otherwise the request would fail the member id check, or the group generation check. I'm not entirely sure of joining an "admin consumer" to the same group, and committing offsets would force the other consumers to re-read the offsets, but it might force a rejoin if the generation is changed, and that might force them to re-read offsets. I'm no expert here. |
Beta Was this translation helpful? Give feedback.
-
For info, what I wanted to do is doable with kafka's official kafka-consumer-groups.sh. I think this functionality will be a great addition one day for the rpk. |
Beta Was this translation helpful? Give feedback.
For info, what I wanted to do is doable with kafka's official kafka-consumer-groups.sh. I think this functionality will be a great addition one day for the rpk.