Hi everyone,
I need to implement following functionality. There is a kafka topic where "forward" events are coming and in the same topic there are "cancel" events. For each "forward" event I need to wait 1 minute for possible "cancel" event. I can uniquely match both events. If "cancel" event comes within this minute I need to delete "forward" event, otherwise pass "forward" event further in another kafka topic. "Cancel" events older than 1 minute could be ignored. I was thinking to implement ProcessFunction with putting "forward" events in state with timer. If "cancel" event is coming I will delete "forward" event from state. My question: Is there more simple way to implement the same logic, possibly with CEP ? Thanks, Maxim. |
Hi Maxim, I think your problem should be solvable with the CEP library: public static void main(String[] args) throws Exception { So what we are doing here is to define a pattern forward followed by any cancel. Moreover we say that it must happen within 1 minute. If this does not happen then we will see a timeout where we can create the follow-up event. Cheers, Till On Thu, Apr 30, 2020 at 12:48 PM Maxim Parkachov <[hidden email]> wrote:
|
Hi Till, thank you for very detailed answer, now it is absolutely clear. Regards, Maxim. On Thu, Apr 30, 2020 at 7:19 PM Till Rohrmann <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |