You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Michael Drogalis (JIRA)" <ji...@apache.org> on 2019/04/08 22:12:00 UTC

[jira] [Created] (KAFKA-8200) TopologyTestDriver should offer an iterable signature of readOutput

Michael Drogalis created KAFKA-8200:
---------------------------------------

             Summary: TopologyTestDriver should offer an iterable signature of readOutput
                 Key: KAFKA-8200
                 URL: https://issues.apache.org/jira/browse/KAFKA-8200
             Project: Kafka
          Issue Type: Improvement
            Reporter: Michael Drogalis


When using the TopologyTestDriver, one examines the output on a topic with the readOutput method. This method returns one record at a time, until no more records can be found, at which point in returns null.

Many times, the usage pattern around readOutput will involve writing a loop to extract a number of records from the topic, building up a list of records, until it returns null.

It would be helpful to offer an iterable signature of readOutput, which returns either an iterator or list over the records that are currently available in the topic. This would effectively remove the loop that a user needs to write for him/herself each time.

Such a signature might look like:

{code:java}
public Iterable<ProducerRecord<byte[],byte[]>> readOutput(java.lang.String topic);
{code}




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)