Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong documentation for ReaderConfig.startOffset #281

Open
AndreasKorn opened this issue Mar 21, 2024 · 2 comments
Open

Wrong documentation for ReaderConfig.startOffset #281

AndreasKorn opened this issue Mar 21, 2024 · 2 comments

Comments

@AndreasKorn
Copy link

According to the documentation the valid values for ReaderConfig.startOffset (https://github.com/mostafa/xk6-kafka/blob/main/api-docs/docs/interfaces/ReaderConfig.md#startoffset) are the constants START_OFFSETS_FIRST_OFFSET and START_OFFSETS_LAST_OFFSET.

Those two constants are not included in the module-level constants (see console.log(kafka);) and therefor have no value set and do not work.
The module-level constants include the constants FIRST_OFFSET and LAST_OFFSET though (which work fine).

@mostafa
Copy link
Owner

mostafa commented Mar 21, 2024

Hey @AndreasKorn,

Happy to see contributions.

@lsoewito13
Copy link

lsoewito13 commented Aug 26, 2024

I tried using both START_OFFSETS_LAST_OFFSET and LAST_OFFSET, but didn't work for me.
The consumer always gets the first offset message in the topic, instead of last one.
Here is my Reader config. Did I miss anything?

import {
LAST_OFFSET,
} from "k6/x/kafka";

const sinkTopicReader = new Reader({
brokers: brokers,
partition: 0,
groupTopics: [sinkTopic],
groupID: "test-consumer-group",
startOffset: LAST_OFFSET,
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants