Hi Manna,

If needed i will close, it's sample one i mentioned, I am thinking of 2
options like
1) keep pool of threads which will receive the data and send continuously
using producer
2) when ever sending create a thread ,send data and close the thread (may
be one point of time 300 threads also will create)


Regards,
Ranjit

On Fri, Nov 17, 2017 at 11:47 PM, M. Manna <[email protected]> wrote:

> Are you planning to close these at any point? I'm not seeung any close()
> calls.
>
> On 17 Nov 2017 6:09 pm, "Ranjit Kumar" <[email protected]> wrote:
>
> Hi All,
>
> I am writing java program with thread pool may be  100 threads  and all
> threads will have kafka producers
> (org.apache.kafka.clients.producer.ProducerRecord) for the same topic,
> will
> their be any problem ?
>
>        thread-1
>         ProducerRecord<String, String> data = new ProducerRecord<>(topic,
> msg); // same topic
>         stringProducer.send(data);
>
>        thread-2
>         ProducerRecord<String, String> data = new ProducerRecord<>(topic,
> msg); // same topic
>         stringProducer.send(data);
>
>        thread-3
>         ProducerRecord<String, String> data = new ProducerRecord<>(topic,
> msg); // same topic
>         stringProducer.send(data);
>
> Regards,
> Ranjit
>

Reply via email to