Class MockProducer<K,​V>

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, Producer<K,​V>

    public class MockProducer<K,​V>
    extends java.lang.Object
    implements Producer<K,​V>

    This class is not supported.

    A mock of the producer interface you can use for testing code that uses Kafka.

    By default this mock will synchronously complete each send call successfully. However it can be configured to allow the user to control the completion of the call and supply an optional error for the producer to throw.