It may be too late to change the Producer API now. I always find "ListenableFuture" is very nice/usable. It essentially adds callback to Future. It's a lot easier to chain/combine ListenableFuture. http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/util/concurrent/ListenableFuture.html
On Wed, Sep 24, 2014 at 6:05 PM, Guozhang Wang <wangg...@gmail.com> wrote: > Hi, > > In the new (Java) producer, you can pass in a callback function in the > > Future<RecordMetadata> send(ProducerRecord record, Callback callback) > > call, which will be triggered when the ack is received. > > Alternatively, you can also call Future.get() on the returned future > metadata, which will block until the ack is received (i.e., synced > sending). > > Guozhang > > On Wed, Sep 24, 2014 at 6:10 AM, Sreenivasulu Nallapati < > sreenu.nallap...@gmail.com> wrote: > > > Hello, > > > > Can you please help me to get the acknowledgement in producer? > > > > > > After setting the property *request.required.acks to 1, *how producer > gets > > the acknowledgement back? I am trying to get the acknowledgement in java > > producer. > > > > > > > > > > > > Thanks > > > > Sreeni > > > > > > -- > -- Guozhang >