使用Siddhi 1.x我们可以做到:
siddhiManager.defineStream(“define stream firstStream(id int,name string)”); siddhiManager.defineStream(“define stream secondStream(id int,name string)”); siddhiManager.defineStream(“define stream thirdStream(id int,name string)”);
siddhiManager.addQuery("from every F = firstStream " +
" -> S = secondStream [F.id == S.id] within 1 min" +
"insert into midStream F.id as id, F.name as name, S.id as secondId ;");
siddhiManager.addQuery("from every M = midStream " +
" -> T = thirdStream [M.id == T.id] within i min " +
"insert into outputStream M.id, M.name, T.id");
InputHandler firstEventHandler = siddhiManager.getInputHandler("firstStream");
InputHandler secondEventHandler = siddhiManager.getInputHandler("secondStream");
InputHandler thirdEventHandler = siddhiManager.getInputHandler("secondStream");
然后我们可以将事件发送给适当的处理程序。我想用版本3.0.4做同样的事情
使用Siddhi 3.0.4整个定义定义为
String executionPlan1 =“define stream ..”+ “@info(name ='query')”+ “来自...”;
ExecutionPlanRuntime executionPlanRuntime1 =
siddhiManager.createExecutionPlanRuntime(executionPlan1);
所以我尝试创建多个ExecutionPlanRuntime&每个都有自己的流定义,但它没有用。 我们还需要定义midStream吗?
谢谢&此致