xk6-kafka
xk6-kafka copied to clipboard
Error when consuming more messages that exist in topic
Steps to reproduce:
- Create a Reader with offset 10
- Last offset of the topic is 13
- I want to consume 10 messages
Expected result I just get 3 messages back, as are the ones that exist in the topic
Actual result
I get the 3 messages back but I have an error I can't even catch in k6:
It comes from here https://github.com/mostafa/xk6-kafka/blob/main/reader.go#L344 but I can't capture it as an
XK6KafkaError
.
@vvargas90
This is the expected behavior based on the current design. Would be happy to see contributions.
Why is that? It's not even possible to see what the error is @mostafa
@davidgomesdev @vvargas90
Good question! I am trying to fix it. Will raise a PR soon and would be happy to have your feedback.
@davidgomesdev @vvargas90 Can you test the changes?
Hi @mostafa, I was referring to it lacking details, rather than not being catch-able, it now indeed is possible to catch the error, but I wanted to see more information regarding the error itself.
@davidgomesdev I won't be able to decipher the error any more than you do. I made the kafka-go's error catch-able, so you can search the error in that library.
This was what I meant @mostafa #288