You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Mario Ricci <Ma...@Trimble.com> on 2016/04/05 17:56:37 UTC

Question on Java client consumer.seek()

I found this thread<https://mail-archives.apache.org/mod_mbox/kafka-users/201602.mbox/%3CCACyXnod_zZJsTv0Xuu_totRtsC5P+zaHi_9YeGoEv8Mh3daRcA@mail.gmail.com%3E> and see that poll() must be called before seek().

This seems unintuitive and the error message ("No current assignment for partition partitionName") is not very helpful.

Why wouldn't subscribe take care of partition assignments and leave it to the first call of poll()?  Alternately, if someone feels strongly about keeping assignments tied to the poll() method, could we just append something on to the error message to something like: "No current assignment for partition partitionName.  If you called seek() you must call poll() first".

I can see this being confusing for others, especially if they are designing something that needs to start processing at the end or somewhere in between.

Mario Ricci


Re: Question on Java client consumer.seek()

Posted by "Matthias J. Sax" <ma...@confluent.io>.
Sounds reasonable to me.

On 04/05/2016 05:56 PM, Mario Ricci wrote:
> I found this thread<https://mail-archives.apache.org/mod_mbox/kafka-users/201602.mbox/%3CCACyXnod_zZJsTv0Xuu_totRtsC5P+zaHi_9YeGoEv8Mh3daRcA@mail.gmail.com%3E> and see that poll() must be called before seek().
> 
> This seems unintuitive and the error message ("No current assignment for partition partitionName") is not very helpful.
> 
> Why wouldn't subscribe take care of partition assignments and leave it to the first call of poll()?  Alternately, if someone feels strongly about keeping assignments tied to the poll() method, could we just append something on to the error message to something like: "No current assignment for partition partitionName.  If you called seek() you must call poll() first".
> 
> I can see this being confusing for others, especially if they are designing something that needs to start processing at the end or somewhere in between.
> 
> Mario Ricci
> 
>