onTimer function is not getting executed and job is marked as finished.

Posted by Puneet Kinra-2 on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/onTimer-function-is-not-getting-executed-and-job-is-marked-as-finished-tp25361.html

Hi All

Facing some issue with context to onTimer method in processfunction

class TimerTest extends ProcessFunction<Tuple2<String,String>,String>{

/**
*/
private static final long serialVersionUID = 1L;

@Override
public void processElement(Tuple2<String, String> arg0,
ProcessFunction<Tuple2<String, String>, String>.Context ctx, Collector<String> arg2) throws Exception {
// TODO Auto-generated method stub
long parseLong = Long.parseLong(arg0.f1);
TimerService timerService = ctx.timerService();
ctx.timerService().registerProcessingTimeTimer(parseLong + 5000);
}

@Override
public void onTimer(long timestamp, ProcessFunction<Tuple2<String, String>, String>.OnTimerContext ctx,
Collector<String> out) throws Exception {
// TODO Auto-generated method stub
super.onTimer(timestamp, ctx, out);
System.out.println("Executing timmer"+timestamp);
out.collect("Timer Testing..");
}
}

--
Cheers 

Puneet Kinra

Mobile:+918800167808 | Skype : [hidden email]

e-mail :[hidden email]