Running
ccloud kafka topic consume <topic> -b --print-key
ends with error: panic: runtime error: index out of range [0] with length 0
What I am wondering is if this is something that can happen or am I looking at some kind of corrupt data in this topic?
Why I ask this, is because I am getting a null pointer exception in one of the services consuming a topic and I am not really sure why it happens since I would expect that even in the case of tombstone record key
will not be null but value
can be null (is null if tombstone record). So after filtering out messages that are null
in value I am not sure what else to do?
[EDIT]: When I try the same thing with a confluent-kafka-python
library then I get no error, but I do get some null records in the process.
It seems that for now the error in code, when reading from a topic is solved with filtering out null values.
.filter((key, value) -> key != null || value != null)
I would have thought null
keys are skipped?
[EDIT 2] Connected to my other, but related, problem not described here. I had no idea that .toStream()
after a join with another KTable
will push down the chain a tombstone record.