return false;
}
- if (clock.instant().isAfter(timeNextRetryIsDue))
+ Instant now = clock.instant();
+ Duration remaining = Duration.between(now, timeNextRetryIsDue);
+ if (remaining.isNegative())
{
numRetries++;
+ log.info("{} - {}. retry for {}, lateness: {}", id, numRetries, topicPartition, remaining.abs());
initializeNextBackOff();
- log.info("{} - Retrying {}", id, topicPartition);
return false;
}
else
{
- log.info("{} - Next retry for {} is due at {}", id, topicPartition, timeNextRetryIsDue);
+ log.info("{} - Next retry for {} is due in {}", id, topicPartition, remaining);
return true;
}
}