zaracoder-stack opened a new pull request, #21100:
URL: https://github.com/apache/kafka/pull/21100

   ## Motivation
   
   This pull request addresses a common pain point for new users learning how 
to develop applications with Kafka clients: testing without relying on a full 
Kafka cluster.
   
   The existing examples primarily focus on runtime operation. These new 
examples show the proper use of the built-in `MockProducer` and `MockConsumer` 
classes for writing fast, reliable, and decoupled unit tests.
   
   ## Changes
   
   Adds a new directory for testing examples: 
`examples/src/main/java/kafka/examples/testing/`
   
   1. **`MockProducerExample.java`**: Demonstrates basic usage, topic routing, 
metadata checks, and error simulation.
   2. **`MockConsumerExample.java`**: Demonstrates basic usage, message 
processing, offset management (seek/commit), and partition rebalancing.
   3. **`README.md`**: Provides instructions on how to compile and run the new 
examples using Gradle, along with guidance on when to use mocks versus real 
brokers.
   
   ## Notes
   
   The example files follow the style of existing examples in the `examples` 
module and include the Apache License header.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to