Skip to main content

Workflow functions

The extension adds two functions to Otoroshi workflows, in the Cloud APIM - Event brokers category.

Publish​

extensions.com.cloud-apim.event-brokers.publish

Argument
connectionrequired: the id of the connection
optionsthe options of the publish: topic, queue, key, ...
event, events, or dataa CloudEvent, several, or the data of a new event
type, source, subjectthe attributes of the new event
{
"kind": "call",
"function": "extensions.com.cloud-apim.event-brokers.publish",
"args": {
"connection": "connection_...",
"options": { "topic": "orders" },
"data": { "id": 42 },
"type": "com.acme.order.created"
}
}

It returns {"results": [...], "published": true}, one result per event.

Consume​

extensions.com.cloud-apim.event-brokers.consume

Argument
connectionrequired: the id of the connection
optionsthe options of the subscription: topic, group, from, delivery, ...
takehow many events at most (1)
within_mshow long to wait for them (5000)

It returns {"events": [...]}, as CloudEvents, and acks what it returns.