Closed Kristina-Pianykh closed 3 weeks ago
The events are checked in the socket source function for control messages: https://github.com/Kristina-Pianykh/flink-multimetric-alert/blob/b629f79b1c0ecb42946a2ff825f671dd2f3ea9aa/src/main/java/flink_state_access/SocketSource.java#L55-L59
The boolean flag to enable/disable the target pattern is globally scoped within the socket source function: https://github.com/Kristina-Pianykh/flink-multimetric-alert/blob/b629f79b1c0ecb42946a2ff825f671dd2f3ea9aa/src/main/java/flink_state_access/SocketSource.java#L9
The pattern includes the flag check: https://github.com/Kristina-Pianykh/flink-multimetric-alert/blob/b629f79b1c0ecb42946a2ff825f671dd2f3ea9aa/src/main/java/flink_state_access/StreamingJob.java#L40
The Flink lib unfortunately still doesn't offer the feature of dynamically updating the CEP patterns at runtime (to add or remove them based on application changes). But there's a workaround.
multiSinkEnabled
) to reflect whether the multi-sink pattern is enabled. Where: the socket source function.This will affectively not apply the multi-sink pattern anymore after the switch which is equivalent to removing it altogether.