oleksiyk / kafka

Apache Kafka 0.9 client for Node
MIT License
297 stars 85 forks source link

How to ensure all messages are read #251

Open rafaelvicio opened 5 years ago

rafaelvicio commented 5 years ago

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?