On the way: filter and steps
Eventing 5 · 3:21
A filter decides which events an event subscription passes on, and a step changes each event before it reaches the channel, in this video by turning a JSON body into fields.
This part of the video couldn't be loaded.
What it covers
- A filter with the JSONPath
$.invoicein the subscription document - Plain-text events that the filter removes, counted in the subscription's log
- Adding the
json-deserialize-actionstep understeps - Each change built as a new version and deployed with
weikio run - The subscription drawn as boxes in a row in the admin UI
- The flow, the version and the state in
weikio get eventsubscriptions
Commands in this video
Terminal
$ weikio run ./files-to-invoices
$ weikio run ./invoice-files
$ weikio logs sandbox/files-to-invoices -f --since 10m
$ weikio get eventsubscriptionsTranscript
- 0:02The flow from the source to the channel already runs end to end. This video shapes what happens on the way.
- 0:12Three folders on your machine build the flow.
- 0:15Your Weik.io installation keeps the source, subscription and channel as integrations,
- 0:22each at its first version.
- 0:23The subscription forwards every message from invoice-files to invoice-created.
- 0:29All four are deployed and running in devtest.
- 0:32Messages sit on both channels.
- 0:34Agent dev runs the four integrations.
- 0:41The middle of the flow is the subscription file, files-to-invoices.yaml.
- 0:46Its spec names two channels: the one it reads and the one it writes to.
- 0:51The empty space beside them is where the filter goes.
- 0:54The filter states what an event must satisfy before the subscription forwards it.
- 1:01The filter forwards bodies with a node at $.invoice.
- 1:06weikio run on the files-to-invoices folder builds version 0.1.1,
- 1:13and the deployment that follows latest puts it live.
- 1:17Nothing is dropped yet, because every message carries the node.
- 1:22The message becomes a note with no invoice node,
- 1:25the folder runs, and the note goes live.
- 1:29The message goes back to an invoice body, then the folder runs.
- 1:34A new invoice reaches the watcher again.
- 1:40weikio logs on the subscription reads the last ten minutes, then follows.
- 1:46Each drop leaves an INFO line, never an error.
- 1:54The next change goes into the same document.
- 1:57weikio run on the files-to-invoices folder builds version 0.1.2 and puts the change live.
- 2:05Under steps, the document lists one kamelet action: json-deserialize-action.
- 2:12The event runs through the steps in order, after the filter and before the channel,
- 2:17and json-deserialize-action opens the JSON body into fields.
- 2:23The subscription's page in the admin UI draws this document as a row of boxes: the channel it reads,
- 2:30the filter, one step and the channel it writes to, with the default error handler named below.
- 2:39weikio get eventsubscriptions lists the project's subscriptions. The row shows the same source and channel,
- 2:47now at its latest version, running in devtest.
- 2:55This is the whole flow: source, filter, steps, channel.
- 3:00The source sends invoices on its timer.
- 3:03The filter forwards what passes and counts the drops.
- 3:07The channel delivers what reaches it.
- 3:09Each step opens the body into fields.
Next in this track
Eventing 6 · 3:21 Dead letters Watched