0

Based on what I read on documentation and source code, WSO2CEP works as a passive software, so it only does something if a stream event arrives on it. So if I want to develop some "health check" on the stream, I need to implement it by myself. My question is, does anyone have a first step on how to do it? I am a little lost on where to start. Do I use InputEventAdapterFactory or TimeWindowProcessor? My scenario is "simple", if a stream does not arrive on a x time, I need to create a alert.

Thanks,

Marcelo Sabino

Community
  • 1
  • 1

1 Answers1

0

This concept will work.

@Plan:name('ExecutionPlan')

@Import('rss.in:1.0.0')
define stream inStream (meta_title string, meta_description string, meta_url string);

define trigger ThirtySecTriggerStream at every 30 sec;

from inStream#window.length(1)
select meta_title, time:currentTimestamp() as meta_time
insert into table1;

from ThirtySecTriggerStream join table1
select meta_title, meta_time
insert into tempStream;

from ThirtySecTriggerStream[time:timestampInMilliseconds(meta_time)-time:timestampInMilliseconds(time:curretTimestamp())>30000]
select meta_title
insert into OutStream
  • I tried this aproach but it does not work. Just to be clear, my need is to check if cep is receiving signal or not. I read the documentation and trigger is only executed if receive a signal, am I correct? – Marcelo Sabino Nov 25 '16 at 17:25
  • what is the purpose of the `#window.length(1)` on the first query ? – Jérémie B Jan 12 '17 at 17:16