Hi Elias,

KIP-62
<https://cwiki.apache.org/confluence/display/KAFKA/KIP-62%3A+Allow+consumer+to+send+heartbeats+from+a+background+thread>
has a discussion of current options, and the improvements that are coming.

Best,

Shikhar

On Thu, Jun 30, 2016 at 6:02 PM Elias Levy <[email protected]>
wrote:

> What is the officially recommended method to heartbeat using the new Java
> consumer during long message processing times?
>
> I thought I could accomplish this by setting max.poll.records to 1 in the
> client, calling consumer.pause(consumer.assignment()) when starting to
> process a record, calling consumer.resume(consumer.paused()) when done
> processing a record and committing its offset, and calling consumer.poll(0)
> intermittently while processing the record.
>
> The testing shows that consumer.poll(0) will return records, rather than
> returning nil or an empty ConsumerRecords.
>

Reply via email to