I have a sequence of events in a topic T1 with key as employee Id, value as employee object.
eg:
Key: Value (JSON)
1000: bob,24,department1,etc
1002: sam,35,department2,etc
1003: anna,26,department1,etc
1000: bob,34,department2,etc`
Using kafka streams I need compare with old value that is processed and identify whether its CREATE, UPDATE and have to generate events to topic T2 say
eg:
Key: Value (JSON)
1000: CREATE,bob,24,department1,etc
1002: CREATE,sam,35,department2,etc
1003: CREATE,anna,26,department1,etc
1000: UPDATE,bob,34,department2,etc`
How do I achieve this functionality? can I use reduce operation? If so, how ?