Skip to main content

The plugins

PluginDoes
Cloud APIM - HTTP events ingesterpublishes the request body: one event, a batch, or newline-delimited events (Publishing)
Cloud APIM - HTTP events consumerstreams events as newline-delimited JSON (Consuming)
Cloud APIM - SSE events consumerstreams events as server-sent events (SSE and websockets)
Cloud APIM - Websocket Ingester/Consumerpublishes incoming frames, streams events back (SSE and websockets)
Cloud APIM - Events request replypublishes the request, answers with the event replying to it (Request reply)

Their identifiers are in the reference. They call no backend: the target of their route does not matter.

Configuration​

Every plugin points to a connection, and decides what its callers may ask:

{
"ref": "connection_...",
"options": { "topic": "orders-${apikey.metadata.tenant}", "group": "billing" },
"allowed_overrides": ["take", "drop", "duration", "format", "heartbeat"],
"allowed_topics": [],
"include_query": true,
"include_headers": true
}
  • options are what the route fixes: the options of a publish or a subscription, the topic first. Their values may hold Otoroshi expressions (${apikey.metadata.tenant}, ${req.headers.x-tenant}, ${user.email}), evaluated for each call.
  • A caller sets options with query parameters and headers prefixed with x-ca-event-broker-opts- (?x-ca-event-broker-opts-take=10), but only those in allowed_overrides: anything else is refused with a 400. By default a caller can only shape its own response (take, drop, duration, format, heartbeat); the topic, the group, the start position, the delivery stay the route's. ["*"] allows everything.
  • What a caller sends is never evaluated as an expression.
  • When the caller may name the topic (queue, channel, stream, address), allowed_topics holds the glob patterns it must match (["orders-*"]); empty, any.
  • Where an event says it goes (the vendor_metadata of the legacy format) is held to the same rules.
  • include_query and include_headers: where the options of a caller are read from.

The route's own security (api keys, JWT verification, authentication modules, quotas) applies before: the plugin only decides what an allowed caller may ask of the broker.

Errors​

A plugin answers an error before streaming anything when it cannot serve the call:

StatusWhen
400what the call got wrong: an option it may not set, no topic, something the broker cannot do
500the route points to a connection that does not exist
502what the broker refused: a queue that does not exist, a subscription it would not open
503the connection is not connected on this node, with a Retry-After