<@U04SE163WC8> when I use kafka source with avro ,...
# ask-ai
f
@kapa.ai when I use kafka source with avro , I got this log error: Internal message: java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.JsonNode.asText()" because the return value of "com.fasterxml.jackson.databind.JsonNode.get(String)" is null -- WHY?
k
The error message you're seeing indicates that a function is trying to invoke a method on a null object. In this case, it's trying to call
asText()
on a
JsonNode
object that is null. This could be due to the Kafka source returning an empty or null message. Unfortunately, the knowledge sources provided do not contain a direct solution to this issue with the Kafka source and Avro. However, there's a similar issue reported in the Airbyte Github repository where a user solved a problem with empty messages in the Kafka connector by editing the source code of the connector. Here's the code snippet they provided:
Copy code
java .withData(Jsons.jsonNode(ImmutableMap.builder().put(&quot;value&quot;, output).build())));
Please note that modifying the source code should be done with caution and understanding of the changes you're making. If the issue persists, I recommend reaching out to the Airbyte community or support for further assistance. Knowledge Source: [Github Issue (open): [source-kafka] Empty messages > Comments](https://github.com/airbytehq/airbyte/issues/29464)