Status
Current state: Under Discussion
Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]
JIRA: here
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Motivation
When using the TopologyTestDriver to assert topologies are working as expected, it can be useful to know the full set of topics the topology output to during a test run. This information allows all the outputs of a test run to be captured without prior knowledge of the output topics. The set of output topics and the output records can then be captured and used to ensure future runs output the same records to the same topics. This can be useful to ensure compatibility after changes to the topology or after changes to the Kafka Streams version.
Public Interfaces
Addition of a new method to TopologyTestDriver:
/** * Get all the names of all the topics to which records have been output. * <p> * Call this method after piping the input into the test driver to retrieve the full set of topics the topology * produced records to. * <p> * The returned set of topic names includes changelog, repartition and sink topic names. * * @return the set of output topic names. */ public final Set<String> getOutputTopicNames(){...}
Proposed Changes
Addition of:
public final Set<String> getOutputTopicNames() { return Collections.unmodifiableSet(outputRecordsByTopic.keySet()); }
Compatibility, Deprecation, and Migration Plan
None
Rejected Alternatives
None