0

I want to implement a Kafka Producer with Spring that observes a Cloud Storage and emits meta informations about newly arrived files. Until now we did that with a Kafka Connector but for some reasons we now have to do this with a simple Kafka producer.

Now I need to persist the state of the producer (e.g. timestamp of last commited file) in a kind of Offset Topic like the Connector did, but did not find a reasonable approach to do that.

My current idea is to hold the state by committing it to a topic that the producer also consumes but just acknowledge the last consumed state when commuting a new one. So if the Kubernetes pod of the producer dies and comes up again to consume the last state (not acknowledged) and so knows where it stopped.

But this idea seems to be a bit complex to just hold a state of a Kafka app. Is there a better approach for that?

maimArt
  • 389
  • 1
  • 11

0 Answers0