kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Orelowitz, David" <david.orelow...@baml.com>
Subject Reading only the latest message
Date Fri, 05 Dec 2014 20:42:48 GMT
What is the best mechanism to retrieve the latest message from a kafka partition.

We intend for our producer, on startup or recovery, to read the upstream sequence number in
the last message in the partition and request for the upstream system to start sending from
that sequence number++.

Currently we are creating a SimpleConsumer and then calling  getOffsetBefore() using the current
wall time. We then decrement the offset returned and retrieve the message at this offset.
We do manage the case when the offset is zero.

It seem to work!

Is this the right approach.


This message, and any attachments, is for the intended recipient(s) only, may contain information
that is privileged, confidential and/or proprietary and subject to important terms and conditions
available at http://www.bankofamerica.com/emaildisclaimer.   If you are not the intended recipient,
please delete this message.

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