1

My UseCase is this: in Cumulocity many events from Devices are collected and processed by some 'Cumulocity Event Language' Scripts. Now i need this data be processed further in some backoffice and analysis systems. My Idea is to PUSH the data by an Time-Window-Boxed CEL Script to that "external" systems, by writing an own (e.g.) JavaScript Function (see 'https://www.cumulocity.com/guides/event-language/advanced/') and POST the collected data via an REST call to that systems (which need to have an apropriate service running).

Question: 1) could this idea work? 2) can i load helper libraries (in JS in my case) into the CEL module? 3) can i repeat my attempt of Pushing if it fails?

Thanks MB

mbader
  • 11
  • 2

1 Answers1

1

You cannot create requests directly from within the CEL but there are other ways to achieve that:

  1. You can use Zapier to forward data to another REST Service (Check the "Webhooks by Zapier" app in Zapier). Here is some introduction how to connect Cumulocity with Zapier http://cumulocity.com/guides/users-guide/saas-integration/ (Check the "Store CEL data in Google Spreadsheet" example. If you replace Google Spreadhsheets with the Webhooks app it should be what you are looking for)

  2. You can implement your own connector. The output of every CEL statement is available on the realtime notification API (http://cumulocity.com/guides/reference/real-time-statements/#notifications). You can connect there and forward the received data to your REST service. This is more or less also how the Zapier connector works. Here you could also add repeat logic for failed tries.

I would recommend to start with Zapier. You can prototype your idea very fast and for testing the free version of Zapier should be enough. If it doesn't fit everything you can still switch to do it with an own implementation.

TyrManuZ
  • 2,039
  • 1
  • 14
  • 23
  • Thanks. As i understand the mechanism is based on 'Bayeux'; the use case of this protocol is: 'plaease inform me immediately, if some eventually event happens'; it performs http-long-polling to acheve this. But my use case is this: 'send me **all** measurements - maybe 1k/s - to my REST service. So my question: * does that 'Baye:ux protocol' scale horizontally? I expect many C8y Servers and many of my Backoffice Severs... * can i instantiate many Bayeux Clients simultanously? * if yes: is every event transmittied only once? * what if an transfer breaks down "in the middle"? – mbader Jul 18 '16 at 15:30
  • Yes there is a cluster solution in CometD called Oort. You can of course connect as many clients as you want but if you subscribe to the same channels all clients will receive everything so you have to split the subscribptions. For ensuring data transfer CometD has the message acknowledgment extension – TyrManuZ Jul 20 '16 at 08:42