2

Handling exceptions in Kafka streams is similar question but the accepted answer only talks about the productionException. How to handle the exceptions occurring during the processing and thereby how to control the manually offset committing.

shubhamcs
  • 21
  • 3
  • 1
    Maybe you can find out what you are after in this doc: https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Streams+Architecture#:~:text=For%20fatal%20exceptions%2C%20Kafka%20Streams,up%20with%20an%20fatal%20exception. – g_bor Sep 01 '20 at 13:52

2 Answers2

0

You need to handle them manually, ie, use own try-catch blocks and react to them accordingly.

Matthias J. Sax
  • 59,682
  • 7
  • 117
  • 137
  • how can I perform manual offset commit Acknowledge#acknowledge() or Acknowledge#nack() with `try-catch`? – shubhamcs Sep 02 '20 at 15:53
  • 1
    Not sure what your question is? But in Kafka Streams, you cannot control committing but it's done for you automatically. If you question is about, for example, how can you handle an error in `filter()`, you could for example just `return false` if an exceptions occurs to drop the record. -- It's highly business logic dependent how you want to handle it. – Matthias J. Sax Sep 02 '20 at 16:20
0

You may find the usage of this library helpful Libraries for error handling in Kafka Streams it offers various wrappers and a DLQ handling. Using it myself to grab exception while processing messages in stream processors. Only gap I‘ve seen is when you‘d like handle cases across multiple operations in a topology.

Thomas
  • 25
  • 8