Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-3538

Abstract the creation/retrieval of Producer for stream sinks for unit testing

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 0.10.0.0
    • 0.10.0.1
    • streams

    Description

      The StreamThread creates producer/consumers directly as KafkaProducer and KafkaConsumer, thus eliminating my ability to unit test my streams code without having an active Kafka nearby. Could this be abstracted in a way that it relies on an optional ProducerProvider or ConsumerProvider implementation that could inject a mock producer/consumer for unit testing? We do this in all our kafka code for unit testing and if a provider is not offered at runtime, we create the concrete KafkaProdocer/Consumer components by default.

      Attachments

        Issue Links

          Activity

            People

              guozhang Guozhang Wang
              mdcoon Michael Coon
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: