This module demonstrates how to use the processing exception handler to manage processing errors in Kafka Streams Processor API.
To compile and run this demo, you’ll need:
- Java 25
- Maven
- Docker
To run the application manually:
- Start a Confluent Platform in a Docker environment.
- Create a topic named
delivery_booked_topic. - Start the Kafka Streams application.
To run the application in Docker, use the following command:
docker-compose up -dThis will start the following services in Docker:
- Kafka Broker
- Control Center
- Kafka Streams Processing Exception Handler Processor API
Using the Kafkagen produce command, you can produce DeliveryBooked events to the delivery_booked_topic topic.
kafkagen produce -f ../.kafkagen/default-record.jsonTo trigger the processing exception handler, produce a record with a missing numberOfTires field. This will result in a NullPointerException:
kafkagen produce -f ../.kafkagen/processing-error-record.json