I am writing a kafka consumer using Java. I want to keep the real time of the message, so if there are too many messages waiting to be consumed, for example, 1000 or more, I must reject the misunderstood messages and start consuming from the last offset.
For this problem, I am trying to compare the last recorded offset and the last topic offset (only 1 section), if the difference between these two offsets is greater than a certain amount, I will set the last offset as the next offset so that I can discard these redundant messages.
Now my problem is how to get the latest topic bias, some people say that I can use the old consumer, but it's too complicated, does the new user have this feature?
java apache-kafka kafka-consumer-api
Neptune
source share