Search code examples
apache-kafkaapache-kafka-streams

Kafka Streaming Application with Not Null Check


I got a streaming application which is subscribed to two topics and which publishes a topic. One subscribed Topic comes from a datasource beyond my control and gives me null values, where the shouldn't be one.

So I was thinking of implementing a NUll-Check in this Streaming-Application, but I need to know the latest published message, because at the moment the streaming-app is kind of stateless. So I would add a statestore to the streaming-app where I can query the latest message.

Is this a legit approach? Are there other approaches to this topic beyond adding a "State" to the streaming app?


Solution

  • If you want to handle the possible null value within the streams app and keep track of the latest published message, then yes, adding a statestore is the appropriate thing to do.