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

How to skip control batch messages? #268

Open
rhasanoff opened this issue Jan 10, 2024 · 1 comment
Open

How to skip control batch messages? #268

rhasanoff opened this issue Jan 10, 2024 · 1 comment

Comments

@rhasanoff
Copy link

Hi @mostafa,
When consuming messages from kafka with xk6-reader, I get events like this:
{\"value\":[0,0,0,0,0,0],\"topic\":\"notification\",\"partition\":0,\"offset\":1,\"time\":\"2023-11-15T14:16:05Z\",\"highWaterMark\":2,\"headers\":{},\"key\":[0,0,0,1]}

When I consume messages with kafka-console-consume I don't see these events. But when I checked in the UI I saw events are 2 offset apart. After reading this article, it was clear that these are control batch messages. "When using transactions, Kafka insert "control batches" in the logs to indicate if messages were part of a transaction."

My question is if it's possible to skip reading these kind of empty contolbatch messages?

@mostafa
Copy link
Owner

mostafa commented Jan 11, 2024

Hey @rhasanoff,

This extension uses kafka-go underneath and kafka-go doesn't support skipping those messages yet. There is a long-awaited unmerged PR for the specific thing you're asking, so consider skipping them in JS code for now, or give them a hand in moving that PR forward.

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

2 participants