You should take a look at
https://issues.apache.org/jira/browse/SPARK-4122
which is implementing writing to kafka in a pretty similar way (make a new
producer inside foreachPartition)
On Mon, Jan 12, 2015 at 5:24 AM, Sean Owen wrote:
> Leader-not-found suggests a problem with zookeeper config.
Leader-not-found suggests a problem with zookeeper config. It depends
a lot on the specifics of your error. But this is really a Kafka
question, better for the Kafka list.
On Mon, Jan 12, 2015 at 11:10 AM, Hafiz Mujadid
wrote:
> Actually this code is producing error leader not found exception. I
ring, String](Topic, msg))
>> }
>> })
>> producer.close
>> })
>>
>>
>>
>> the problem with this code is that it creates kafka
; the problem with this code is that it creates kafka producer separate for
> each partition and I want a single producer for all partitions. Is there any
> way to achieve this?
>
>
>
>
> --
> View this message in context:
> http://apache-spark-user-list.1001560.n3.nabble.c
})
>
>
>
> the problem with this code is that it creates kafka producer separate for
> each partition and I want a single producer for all partitions. Is there
> any way to achieve this?
>
>
> --
> If you reply to this em
fka producer separate for
each partition and I want a single producer for all partitions. Is there any
way to achieve this?
--
View this message in context:
http://apache-spark-user-list.1001560.n3.nabble.com/creating-a-single-kafka-producer-obje