partitions.forEach(tp ->
{
Integer partition = tp.partition();
- Long offset = consumer.position(tp);
- log.info("{} - adding partition: {}, offset={}", id, partition, offset);
StateDocument document =
repository
.findById(Integer.toString(partition))
.orElse(new StateDocument(partition));
+ log.info("{} - adding partition: {}, offset={}", id, partition, document.offset);
if (document.offset >= 0)
{
// Only seek, if a stored offset was found
partitions.forEach(tp ->
{
Integer partition = tp.partition();
- Long newOffset = consumer.position(tp);
+ Long offset = consumer.position(tp);
log.info(
"{} - removing partition: {}, offset of next message {})",
id,
partition,
- newOffset);
+ offset);
if (commitsEnabled)
{
- repository.save(new StateDocument(partition, handler.removePartition(partition), newOffset));
+ repository.save(new StateDocument(partition, handler.removePartition(partition), offset));
}
else
{