You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Ashish Shenoy <as...@instartlogic.com> on 2015/09/14 23:06:58 UTC

Thread safety when committing from multiple threads

Hi,

I have a multi-threaded Kafka consumer. I have auto commit disabled and
from each thread, I periodically call commitOffsets() to commit the offsets
to Kafka.

Is this thread safe ? What is the effect of calling commitOffsets()
concurrently from multiple threads ? Should the consumer writer ensure that
the call to commitOffsets() is synchronized across multiple threads ?

Thanks,
Ashish

Re: Thread safety when committing from multiple threads

Posted by Ashish Shenoy <as...@instartlogic.com>.
Hi,

Can anyone please shed some light on this ? I couldn't find any pointers
online other than this:
http://stackoverflow.com/questions/26477585/when-calling-commitoffsets-on-kafka-high-level-consumerconnector-what-value-get


Thanks,
Ashish

On Mon, Sep 14, 2015 at 2:06 PM, Ashish Shenoy <as...@instartlogic.com>
wrote:

> Hi,
>
> I have a multi-threaded Kafka consumer. I have auto commit disabled and
> from each thread, I periodically call commitOffsets() to commit the offsets
> to Kafka.
>
> Is this thread safe ? What is the effect of calling commitOffsets()
> concurrently from multiple threads ? Should the consumer writer ensure that
> the call to commitOffsets() is synchronized across multiple threads ?
>
> Thanks,
> Ashish
>