xk6-kafka icon indicating copy to clipboard operation
xk6-kafka copied to clipboard

Error when consuming more messages that exist in topic

Open vvargas90 opened this issue 1 year ago • 1 comments

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: image 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 avatar Feb 01 '24 09:02 vvargas90

@vvargas90

This is the expected behavior based on the current design. Would be happy to see contributions.

mostafa avatar Feb 01 '24 14:02 mostafa

Why is that? It's not even possible to see what the error is @mostafa

davidgomesdev avatar Apr 26 '24 16:04 davidgomesdev

@davidgomesdev @vvargas90

Good question! I am trying to fix it. Will raise a PR soon and would be happy to have your feedback.

mostafa avatar Apr 26 '24 17:04 mostafa

@davidgomesdev @vvargas90 Can you test the changes?

mostafa avatar Apr 26 '24 17:04 mostafa

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 avatar Apr 29 '24 13:04 davidgomesdev

@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.

mostafa avatar Apr 29 '24 13:04 mostafa

This was what I meant @mostafa #288

davidgomesdev avatar Apr 29 '24 15:04 davidgomesdev