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

TopologyTestDriver fails when topoloy under test uses EXACTLY_ONCE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.1.0
    • 1.1.1, 2.0.0
    • streams

    Description

      Stream processing topologies which are configured to use EXACTLY_ONCE processing guarantee cannot be tested with the TopologyTestDriver. Tests usually crash with java.lang.IllegalStateException: MockProducer hasn't been initialized for transactions within the second call to TopologyTestDriver.pipeInput(), the first call works fine.

      Changing the processing guarantee to AT_LEAST_ONCE makes tests pass.

      This is a problem because it is expected that proper processor topologies can be successfully tested using TopologyTestDriver, however TopologyTestDriver can't handle EXACTLY_ONCE and crashes during tests. To a developer, this usually means that there is something wrong with their processor topologies.

      Kafka developpers can reproduce this by adding:

      put(StreamsConfig.PROCESSING_GUARANTEE_CONFIG, StreamsConfig.EXACTLY_ONCE);

      to line 88 of TopologyTestDriverTest: streams/test-utils/src/test/java/org/apache/kafka/streams/TopologyTestDriverTest.java

      Originally reported on the ML.

      Attachments

        Issue Links

          Activity

            People

              jadireddi Jagadesh Adireddi
              frederica Frederic Arno
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: