Clarification. My answer applies to the new producer API in 0.8.2.

regards

On Sun, Apr 12, 2015 at 4:00 PM, Manoj Khangaonkar <[email protected]>
wrote:

> Hi,
>
> For (1) from the java docs "The producer is *thread safe* and should
> generally be shared among all threads for best performance"
>
> (2) (1) implies no pool is necessary.
>
> regards
>
> On Sun, Apr 12, 2015 at 12:38 AM, dhiraj prajapati <[email protected]>
> wrote:
>
>> Hi,
>> I want to send data to apache kafka using the java api of the kafka
>> producer. The data will be in high volume, of the order of more than 5
>> thousand messages per second.
>> Please help me with the following queries:
>>
>> 1. Should I create only one producer object for the entire app and use the
>> same object to send all the messages and then close the producer in the
>> end? Or should I create a producer object for every message to be sent and
>> close the producer connection after sending each message?
>>
>> 2. Does the producer api inherently use a pool of Producer objects? If
>> yes,
>> what is the default size of the pool and is it configurable?
>>
>> Thanks in advance,
>> Dhiraj Prajapati
>>
>
>
>
> --
> http://khangaonkar.blogspot.com/
>



-- 
http://khangaonkar.blogspot.com/

Reply via email to