Delivery and CloudEvents
Weik.io 2026.2How an event goes from the route that publishes it to the routes that receive it, and the CloudEvents 1.0 attributes it carries. Product page · Video
Watch: Delivery: give a channel a type, 3:11
The video gives a channel a type so that the channel delivers every event to another system.
This part of the video couldn't be loaded.
On this page
The integration erp-invoice-export publishes an event with the weikio-event-sink kamelet. The event goes through the agent's leaf node to the hub, and the step waits until Weik.io confirms it stored the event in the channel invoice-created, which the environment's stream keeps for 30 days. The integration invoice-archiver gets the channel's events through a durable reader that the platform created when it was deployed. Its two copies, on agent-fi-01 and agent-fi-02, share the reader, so each event goes to one copy. A failed event comes again after 5s, 15s, 30s, 1m, 2m and 5m, the last delay repeating, and after 10 deliveries it goes to the environment's dead letters. weikio deadletters resend sends it again to the integration it failed in.
Publishing#
A route publishes with to: kamelet:weikio-event-sink?channel=invoice-created. The event goes from the integration’s process to the message server beside the agent and on to the hub.
Reading#
When you deploy an integration that receives a stored channel’s events, Weik.io creates a durable reader for it:
- The integration gets every event published since its first deploy, including those published while it was stopped.
- An event counts as handled once the route has finished it.
- A failed event is delivered again after a delay, up to its last attempt.
- The copies of the integration share the reader, so each event goes to one copy.
weikio stop keeps the reader, so a stopped integration picks up where it left off. weikio undeploy deletes it.
A pass-through channel keeps nothing, so its readers miss what is published while they’re stopped.
Delivery settings#
The delivery block of an integration sets how its events are delivered to it. Every member is optional:
name: invoice-archiver
version: 1.0.0
delivery:
retries: 10
retryDelays: [5s, 15s, 30s, 1m, 2m, 5m]
maxRouteTime: 10m
inFlight: 1
ordered: false| Member | Default | What it sets |
|---|---|---|
retries |
10 | How many deliveries an event gets before it goes to the dead letters, from 1 to 100 |
retryDelays |
[5s, 15s, 30s, 1m, 2m, 5m] |
The wait before each retry, the last one repeating |
maxRouteTime |
10m |
How long one event may run before another copy gets it |
inFlight |
1 | How many events one copy works on at once, from 1 to 100 |
ordered |
false |
true delivers the events one at a time across every copy, in the order Weik.io stored them |
An event that still fails after its last attempt goes to the environment’s dead letters.
Handle each event once#
Every event has an ID that stays the same when it’s delivered again or sent again. When a route’s side effect must not run twice, such as creating an invoice in the ERP, use Camel’s Idempotent Consumer with Weik.io’s repository, #weikioIdempotent. The repository keeps one record per event, shared by every copy of the integration:
- route:
from:
uri: "kamelet:weikio-event-source?channel=invoice-created"
steps:
- idempotentConsumer:
header: Weikio-Event-Id
idempotentRepository: "#weikioIdempotent"
steps:
- to: "{{erp-url}}/api/invoices"An aggregator keeps its open batch in Camel’s in-memory repository. Each event counts as handled once the aggregator has it, so a restart loses the open batch. To keep the batch, use Camel’s JDBC aggregation repository.
A channel that delivers#
To deliver a channel’s events to another system, give the channel a type. The type is the name of any sink kamelet in Camel’s catalog without its -sink suffix. parameters has the kamelet’s parameters:
apiVersion: weik.io/v1
kind: event-channel
metadata: { name: invoice-alerts, project: finance }
spec:
type: slack
parameters:
channel: "#invoices"
webhookUrl: "{{slack-webhook-url}}"Weik.io generates the route that delivers. A channel with a type is an integration with versions and deployments, so deploy it to each environment where it should deliver:
$ weikio apply -f ./finance/events/
$ weikio deploy finance/invoice-alerts --env productionThe delivery is one more reader of the channel, so your integrations can still publish into it and receive its events.
CloudEvents#
Every event Weik.io stores, except an entity store write, carries its CloudEvents 1.0 attributes as ce- headers, in the binary content mode of the CloudEvents binding:
ce-specversionce-id, the event’s IDce-sourcece-typece-timece-subject, when it’s known- The media type, when it’s known
The attributes take about 300 bytes of each event.
A channel with a type sends its events to its sink in the CloudEvents mode you set:
| Mode | What the sink receives |
|---|---|
binary |
The body as it was published and the attributes as headers. This is the default. |
structured |
One application/ document with the attributes and the data |
$ weikio channel create finance/invoice-feed --type http --param url=https://partner.example/events --cloud-events structuredYou find a channel’s mode in the CLOUDEVENTS column of weikio get channels and in the CloudEvents row of its Definition page in the admin UI.
A route sets an attribute with its Camel header:
| Attribute | Camel header |
|---|---|
ce-type |
CamelCloudEventType |
ce- |
CamelCloudEventSource |
ce- |
CamelCloudEventSubject |
ce-time |
CamelCloudEventTime |
| The media type | CamelCloudEventDataContentType |
An event source sets these attributes in its document, apart from the time and the media type.