Bird
0
0

You want to build a Kafka Streams application that processes user events but sends any malformed events to a separate topic without stopping the main stream. Which approach best achieves this?

hard📝 Application Q15 of 15
Kafka - Advanced Stream Processing
You want to build a Kafka Streams application that processes user events but sends any malformed events to a separate topic without stopping the main stream. Which approach best achieves this?
AUse a try-catch inside the stream processor to send bad events to a dead-letter topic
BStop the stream when a malformed event is detected to fix data immediately
CIgnore malformed events and continue processing without logging
DFilter out malformed events before processing without saving them
Step-by-Step Solution
Solution:
  1. Step 1: Understand requirement to keep stream running

    The stream must continue processing even if some events are bad.
  2. Step 2: Choose method to handle bad events

    Using try-catch to catch errors and send bad events to a dead-letter topic allows this.
  3. Final Answer:

    Use a try-catch inside the stream processor to send bad events to a dead-letter topic -> Option A
  4. Quick Check:

    Try-catch + dead-letter topic = best error handling [OK]
Quick Trick: Try-catch plus dead-letter topic keeps stream healthy [OK]
Common Mistakes:
  • Stopping stream on error instead of handling
  • Ignoring bad data without saving for review
  • Filtering bad data without storing it

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes