You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Rajasekar Elango <re...@salesforce.com> on 2013/08/30 19:28:42 UTC

kafka produce API batching

Kafka producer API supports sending a single message and as well sending
list of messages with two different methods. I believe irrespective of
either of send method used, producer internally batches batch.num.messages
and sends them in bulk. Is there any advantage in performance of using
send(List<KeyedMessage<K,V>>
messages)to send multiple messages over sending messages one by one
using send(KeyedMessage<K,V>
message) ?

-- 
Thanks,
Raja.

Re: kafka produce API batching

Posted by Rajasekar Elango <re...@salesforce.com>.
Great. Thanks for reply Jun.

Thanks,
Raja.


On Fri, Aug 30, 2013 at 11:50 PM, Jun Rao <ju...@gmail.com> wrote:

> If you are using the async mode, there is no difference. If you use sync
> mode, the former api gives you a way to batch request in sync node, which
> can lead to better throughput.
>
> Thanks,
>
> Jun
>
>
> On Fri, Aug 30, 2013 at 10:28 AM, Rajasekar Elango
> <re...@salesforce.com>wrote:
>
> > Kafka producer API supports sending a single message and as well sending
> > list of messages with two different methods. I believe irrespective of
> > either of send method used, producer internally batches
> batch.num.messages
> > and sends them in bulk. Is there any advantage in performance of using
> > send(List<KeyedMessage<K,V>>
> > messages)to send multiple messages over sending messages one by one
> > using send(KeyedMessage<K,V>
> > message) ?
> >
> > --
> > Thanks,
> > Raja.
> >
>



-- 
Thanks,
Raja.

Re: kafka produce API batching

Posted by Jun Rao <ju...@gmail.com>.
If you are using the async mode, there is no difference. If you use sync
mode, the former api gives you a way to batch request in sync node, which
can lead to better throughput.

Thanks,

Jun


On Fri, Aug 30, 2013 at 10:28 AM, Rajasekar Elango
<re...@salesforce.com>wrote:

> Kafka producer API supports sending a single message and as well sending
> list of messages with two different methods. I believe irrespective of
> either of send method used, producer internally batches batch.num.messages
> and sends them in bulk. Is there any advantage in performance of using
> send(List<KeyedMessage<K,V>>
> messages)to send multiple messages over sending messages one by one
> using send(KeyedMessage<K,V>
> message) ?
>
> --
> Thanks,
> Raja.
>