You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2017/03/19 16:55:43 UTC

[jira] [Commented] (SPARK-19968) Use a cached instance of KafkaProducer for writing to kafka via KafkaSink.

    [ https://issues.apache.org/jira/browse/SPARK-19968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15931808#comment-15931808 ] 

Apache Spark commented on SPARK-19968:
--------------------------------------

User 'ScrapCodes' has created a pull request for this issue:
https://github.com/apache/spark/pull/17308

> Use a cached instance of KafkaProducer for writing to kafka via KafkaSink.
> --------------------------------------------------------------------------
>
>                 Key: SPARK-19968
>                 URL: https://issues.apache.org/jira/browse/SPARK-19968
>             Project: Spark
>          Issue Type: Bug
>          Components: Structured Streaming
>    Affects Versions: 2.2.0
>            Reporter: Prashant Sharma
>            Assignee: Prashant Sharma
>              Labels: kafka
>
> KafkaProducer is thread safe and an instance can be reused for writing every batch out. According to Kafka docs, this sort of usage is encouraged.
> On an average an addBatch operation takes 25ms with this patch and 250+ ms without this patch.
> Results of benchmark results, posted on github PR.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org