Currently I use Esper 8 in a Java environment to use CEP. Recently I asked myself if it is possible to change the EPL statements at runtime. For example, if you have an Esper CEP running with an EPL statement and you want to change this EPL statement without interrupting the CEP runtime. So the EPL statement is updated every x minutes by an SQL query with new EPL statements or the same. Is this even possible, or do I have to interrupt my Java runtime, change the EPL statement and restart the CEP every time I change the EPL statement? Maybe this question sounds stupid but I don't know much about Esper CEP yet.
Thanks in advance
Esper allows you to make changes to the sets of statements but not to the individual statement. In other words you can deploy (create EPL statements) and undeploy (remove EPL statements) as much as you want, on-the-fly and while running, however the existing EPL statements are not modifiable. Listeners, subscribers, variables, scripts, services etc. and extension code can of course change.
The reason it doesn't allow you to change a statement is that a statement may, and often does, have some state. Like say select count(*) from Event
; This has count as a state. Assuming this was to change to select count(*), avg(price) from Event
, now selecting the count and an average, the runtime doesn't actually remember any events so there is no way the average can be computed retrospectively.
CLARIFICATION: With "deploy" and "undeploy" I do NOT mean to deploy and undeploy the whole application. I mean simply to create some new EPL statements and to remove some EPL statements on-the-fly without any application stop/start.