kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Anderson <manderso...@gmail.com>
Subject Re: poll() question
Date Mon, 04 Feb 2019 18:57:25 GMT
I'm sure I initially made this assumption when trying to read all records
from a compacted topic on application startup and it was incorrect.

Due to latency, threading GC pauses etc it would return 0 when there were
still records on the topic.

Mark

On Mon, 4 Feb 2019, 18:02 Pere Urbón Bayes <pere.urbon@gmail.com wrote:

> Hi,
>   see from the javadocs:
>
> > timeout - The time, in milliseconds, spent waiting in poll if data is not
> available in the buffer. If 0, returns immediately with any records that
> are available currently in the buffer, else returns empty. Must not be
> negative.
>
> for a network problem it will return an exception.
>
> I hope it helps,
>
> -- Pere
>
>
>
> Missatge de Mark Horton <mark@nostromo.net> del dia dl., 4 de febr. 2019 a
> les 18:27:
>
> > This is a theoretical question. I have not seen this behavior but
> > wanted to know if it was possible.
> >
> > If consumer.poll() returns EMPTY, does that always mean no records are
> > currently available? In other words, let's say there are some records
> > in a partition. Could poll() return EMPTY if there was a network
> > problem that caused it to timeout before it could return that record?
> >
> > Mark
> >
>
>
> --
> Pere Urbon-Bayes
> Software Architect
> http://www.purbon.com
> https://twitter.com/purbon
> https://www.linkedin.com/in/purbon/
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message