In addition to this, you want to ensure that "producer.type" is set to
"sync". That will ensure the send is synchronous with acks.

Thanks,
Neha

On Thu, Aug 23, 2012 at 4:36 PM, Rakesh Nair <raknai...@gmail.com> wrote:
> The current project i am doing requires producer requests to be
> acknowledged by kafka. Since this fix seems to have gone into kafka0.8 i
> thought of trying it out. I have a question on whether to use Producer
> class or SyncProducer class for sending the request.
> I am using Producer class for sending the request now.
>
> Properties props = getProp();
> ProducerConfig config = new ProducerConfig(props);
> Producer<String, String> producer = new Producer<String, String>(config);
> ....
>
> In the props i have added two new properties
> "producer.request.required.acks", and "producer.request.timeout.ms".  Then
> i create a ProducerData object and then use "send" method in the Producer
> class.
>
> Does this ensure that the synchronous send happens with ack's ?? Or should
> be using SyncProducer for this purpose.
>
> --
> Regards
> Rakesh Nair

Reply via email to