0
  1. With Siddhi 1.x we could do:

    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");
    

Then we could send events to appropriate handlers. I want to do same thing with version 3.0.4

  1. With Siddhi 3.0.4 entire definition is defined as

    String executionPlan1 = "define stream.. " + "@info(name = 'query') " + "from ..";

    ExecutionPlanRuntime executionPlanRuntime1 = 
                    siddhiManager.createExecutionPlanRuntime(executionPlan1);
    

So I tried creating multiple ExecutionPlanRuntime & each having its own stream definition, but it didn't work. Do we need to also define midStream?

  1. Can anyone kindly suggest correct way to do add multiple queries to SiddhiManager so as to achive what we could do as I had mentioned in 1st point.?

Thanks & Regards

Amy
  • 85
  • 2
  • 7

1 Answers1

0

Yes, you can do the same.. Please check the this reference.. It shows, how you can get input handlers for multiple streams and publish events..

Please note, you don't have to create multiple executionPlanRuntimes here.. And no need to define intermediate stream as well..

If you want to get events from intermediate streams then you just want to create stream callback like this.

Mohanadarshan
  • 830
  • 5
  • 5