flink-siddhi icon indicating copy to clipboard operation
flink-siddhi copied to clipboard

Null pointer with Control stream

Open SMART2016 opened this issue 3 years ago • 0 comments

hi @haoch ,

  I am getting Null-pointer exception when using control stream and publishing data through kafka to input stream. When I debugged I found that somehow the EventListener( SiddhiStreamOperator --> AbstractSiddhiOperator) siddhiRuntimeHandlers map is empty and doesn't have the added rule from the control stream. 

Steps:

  • created two kafka topics one for data stream and one for control stream

  • used control stream in cep.cql:

     DataStream<String> inputStream = getInputDataStream(env).filter(r -> r != null && r.trim() != "" && r.contains("s3log"));
      DataStream<ControlEvent> ruleStream = getRuleStream(env).filter(r -> r != null );
    
     cep.registerStream("inputStream", inputStream, "s3log");
    
      DataStream<Map<String,Object>> failedAttempts = cep.from("inputStream")
              .cql(ruleStream)
              .returnAsMap("outputStream");
    
  • started the flink siddhi application

  • Published the rule in the rule stream kafka Topic first - Debugged and saw that it create 8 instances of AbstractSiddhiOperator all with the siddhiRuntimeHandlers map set with the rule published.

  • Published the data in the data kafka Topic - While debugging I saw that the AbstractSiddhiOperator instance used to evaluate the data doesn't have siddhiRuntimeHandlers map populated with the rule id and runtime handler instance and so it failed with Nullpointer exception. - Am I missing something here due to which the handler is not getting set in the AbstractSiddhiOperator instance while ingesting the data.

Any help will be great.

Regards Dipanjan

SMART2016 avatar Jun 14 '21 06:06 SMART2016