Skip to content

Kafka Compact Topic read all events and move onto next action #195

Answered by msallin
cookie-bytes asked this question in Q&A
Discussion options

You must be logged in to vote

We have such a scenario in which we use Kafka as a database i.e. the service starts and we have to wait for all records to be consumed. Conceptually, you have to ensure that you also compact in memory to ensure you have the current view onto the topic. The reason is that Kafka does not guarantee a point in time for compaction, means you can still receive two messages with the same Kafka key (i.e. for the same entity) on startup. However, there is ofc also the scenario that you receive a new message after the startup.
The good news is that you can just unify this to one concept and you are able to perform the initial load and then also have a constantly updated view to the topic.

We have

  1. m…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by cookie-bytes
Comment options

You must be logged in to vote
1 reply
@cookie-bytes
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants