0

In the Cumulocity guide, https://www.cumulocity.com/guides/event-language/introduction/, there is a mention of Event Streams for HTTP.

HTTP ResponseReceived SendReqeust This group of events represents sending http requests to external services.

This means we can send outbound HTTP request to external services using the "SendRequest" stream. However, I did not find any further details in any documentation. Can you please provide the template CEL details for SendRequest, and how to configure the same in Cumulocity?

Denis Tsoi
  • 9,428
  • 8
  • 37
  • 56

1 Answers1

0

I can not help you using the actual engine (Apama) but I can give you one example using Esper.

@Name("Sending the http request")
@Resilient
insert into 
  SendRequest
select 
  'post' as method,
  'https://tenant.cumulocity.com/inventory/managedObjects' as url,
  'Basic .....' as authorization,
  'application/json' as contentType,
   toJSON(m) as body
from anyEventStream m;

The toJSON if a function that takes the event stream and return is equivalent in json.

You can find more info here. This info is hide from the actual docs and think it is because they want to push developers to use APAMA instead ESPER.

Hope this helps.

Jorge
  • 238
  • 1
  • 10