Search code examples
fiwarecomplex-event-processing

CEP Producer - Timed file adapter


In Fiware CEP's User Manual (pdf), page 12, it's mentioned you can create an event Producer of the type 'Timed', that will retrieve events from a file at intervals of time based on their 'OccurranceTime' property. In my Fi-Lab's intance I don't find this 'Timed' type of producer in the dropdown list, only: File, JMS, Rest and Custom.

So I thought this feature could be implemented in the type 'File', but I can't get it to work, the property 'sendingDelay' in the Producer, always dictates the reading speed, not 'OccurrenceTime' in the event payload. Deleting 'sendingDelay' from the Producer makes it not send events at all.

OccurranceTime is said, in the manual, to be in milliseconds and in the authoring tool it has variable type of 'Date', so "OccurranceTime":"1000" should mean one second.

So, how can I get events produced at desired times? Is it just a matter of correct formating?

(BTW: in the manual OccurranceTime is spelled in two diferent ways: 'OccuranceTime' and 'OccurranceTime'. I believe the correct one is with double 'r', as it's what the authoring tools gives by default when creating a new event.)

Thank you, Arthur


Solution

  • Event producer of type 'Timed' is a new feature that is part of release 4 of the CEP. It should be available in FIWARE Lab on October.

    When available, you could choose it as the producer's type in the CEP Authoring tool. Then, the CEP will read events from an input file. In this file, you will write the expected occurrence time of each event.

    For example, if the content of the input event file in JSON format is:

    {"Name":"TrafficReport", "volume":"1000", "OccurrenceTime":"1000"}
    {"Name":"TrafficReport", "volume":"1600", "OccurrenceTime":"6000"}
    {"Name":"TrafficReport", "volume":"2500", "OccurrenceTime":"11000"}
    

    The producer will process the second input event 5 seconds after the first input event, since it said to occur 5000 ms after the first one.