Ahmed Sadek
Ahmed Sadek

Reputation: 25

No output from the FIWARE complex event processing (CEP) engine

I am sending REST POST request to the FIWARE CEP and expecting output even in a file. But nothing in the file.

REST POST (Producer) -> CEP -> File Consumer
http://194.28.122.118:8080/ProtonOnWebServer/rest/events
{"Name":"TrafficReport", "volume":"9000"}

Catalina.out

Apr 3, 2015 4:54:19 PM com.ibm.hrl.proton.webapp.providers.EventJSONMessageReader readFrom
INFO: started event message body reader
Apr 3, 2015 4:54:19 PM com.ibm.hrl.proton.webapp.providers.EventJSONMessageReader readFrom
INFO: name value: TrafficReport looking for: Name
Apr 3, 2015 4:54:19 PM com.ibm.hrl.proton.webapp.providers.EventJSONMessageReader readFrom
INFO: finished event message body reader
Apr 3, 2015 4:54:19 PM com.ibm.hrl.proton.webapp.resources.EventResource submitNewEvent
INFO: starting submitNewEvent
Apr 3, 2015 4:54:19 PM com.ibm.hrl.proton.router.EventRouter routeTimedObject
INFO: routeTimedObject: forwarding event TrafficReport; Name=TrafficReport; Certainty=0.0; Cost=0.0; EventSource=; OccurrenceTime=null; Annotation=; Duration=0.0; volume=100000; EventId=f4aee2d0-2d4b-4c0c-a24f-ae452896fa75; ExpirationTime=null; Chronon=null; DetectionTime=1428072859603;  to consumer...
Apr 3, 2015 4:54:19 PM com.ibm.hrl.proton.webapp.resources.EventResource submitNewEvent
INFO: events sent to proton runtime...

Upvotes: 2

Views: 431

Answers (1)

Tal Haham
Tal Haham

Reputation: 1638

The reason might be that the path you specified as the Consumer's output file does not exist or that tomcat has no permission to write to this path or to write to the file you specified.

Look at the log file (logs/catalina.out) and see if you see a warning like:

WARNING: initializeAdapters: failed to initialize adapter Output adapter for consumer: DoSAttackTRConsumer, reason: No such file or directorycode here

I would also recommend to use an absolute path and not relative path for the output file path, since in different operating systems, the Tomcat "current" directory might be different.

You don't need to create the file, but you do need to create the directory and make sure tomcat has permission to write to this directory (or if the file exists to write to this file)

So here are my recommendation:

  1. Stop tomcat
  2. Delete catalina.out 
  3. Activate tomcat
  4. In the CEP web UI, change the path of the Consumers to an absolute path, save the project, export it to the repository
  5. Make sure the path you specified for the Consumers exists, and that tomcat has permission to write to the directory, and if the file exist, to this file.
  6. Change the status of the CEP engine to Stop
  7. Change the status of the CEP engine to Start
  8. Send an input event

Make sure you don't see the warning listed above in the catalina.out

Upvotes: 3

Related Questions