You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Navina Ramesh (JIRA)" <ji...@apache.org> on 2015/01/24 02:48:35 UTC

[jira] [Created] (KAFKA-1897) Enhance MockProducer for more sophisticated tests

Navina Ramesh created KAFKA-1897:
------------------------------------

             Summary: Enhance MockProducer for more sophisticated tests
                 Key: KAFKA-1897
                 URL: https://issues.apache.org/jira/browse/KAFKA-1897
             Project: Kafka
          Issue Type: Bug
          Components: producer 
            Reporter: Navina Ramesh
            Assignee: Jun Rao
             Fix For: 0.8.2


Based on the experience of upgrading the kafka producer in Samza, we faced two main constraints when using MockProducer: 

1. The constructor requires a cluster specification and the tools to create a test cluster is not exposed. It is available from TestUtils in Kafka, however that jar is not published. This issue is currently being addressed in KAFKA-1861.
2. No support for testing a blocking client call. For example, "flush" in Samza blocks on the future returned by the latest send request. In order to test this, the MockProducer which buffers it should run in a concurrent mode. There is currently no provision to do this. We want the MockProducer to buffer the send and then, complete the callback concurrently while we wait for "flush" to unblock. 
We can write unit tests that have improved coverage if we can add support for concurrent execution of the MockProducer and unit test thread. For example implementation, please refer to the latest version of KafkaSystemProducer.scala in the Apache Samza repository.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)