Re: New (0.8.2.1) Sync Producer with Batch ?

2015-08-01 Thread Ewen Cheslack-Postava
Sunil,

Batching is performed for you automatically. There are a few settings you
can use to tweak it's behavior (e.g. linger.ms and batch.size), but the
defaults are good for common workloads and can achieve very high throughput.

If you want to send some messages and then wait for them to be acknowledged
before continuing, you can use the futures that are returned by
producer.send(). Just send many messages, then wait for all the futures by
calling get() on them.

The code on the trunk branch also has a flush() method which does the same
thing without you having to collect all the futures. However, that wasn't
added until after 0.8.2.1 was released. It'll be available with 0.8.3 and
simplifies this use case a bit.

-Ewen

On Sat, Aug 1, 2015 at 1:40 AM, sunil kalva sambarc...@gmail.com wrote:

 Can i configure new producer api with batch, and send data in batches in
 synchronous mode ?

 --
 SunilKalva




-- 
Thanks,
Ewen


New (0.8.2.1) Sync Producer with Batch ?

2015-08-01 Thread sunil kalva
Can i configure new producer api with batch, and send data in batches in
synchronous mode ?

-- 
SunilKalva