Event deduplication emiting the very first message and filtering the rest of the duplicates within a tumbling window or a session window, using ksqlDB.
The ID to deduplicate is the eventId
field inside the record payload, thus the first step is to re-key the stream by this field.
The deduplication is done by counting the number of times the eventId
appears in the stream within a window, and only emitting the first event that has a count of 1.