kafka icon indicating copy to clipboard operation
kafka copied to clipboard

How to ensure all messages are read

Open rafaelvicio opened this issue 6 years ago • 0 comments
trafficstars

How can a guarantee be made that all messages that are on the topic have been read by someone consumed?

For example:

When sending 3 messages to a topic X without any consumer reading from topic X

When a new consumer connects to the X topic, it will wait for a message to be published to process it.

This is the default behavior because of a configuration:

recoveryOffset - recovery position (time) which will used to recover subscription in case of OffsetOutOfRange error, defaults to Kafka.LATEST_OFFSET

How can I ensure that I read messages 1 to 3 without repeating messages that I have already processed?

rafaelvicio avatar Mar 13 '19 19:03 rafaelvicio