Skip to content
Weik.ioUniversity
Try Weik.io

On the way: filter and steps

Eventing 5 · 3:09

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.

Download the mp4Recorded on 2026.2

What it covers

  • A filter with the JSONPath $.invoice in the subscription document
  • Plain-text events that the filter removes, counted in the subscription's log
  • Adding the json-deserialize-action step under steps
  • 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 eventsubscriptions
Transcript
  1. 0:02In video four, a type gave the channel its delivery.
  2. 0:05This video shapes what flows on the way, with a filter and steps.
  3. 0:16So far, the flow works end to end.
  4. 0:19The source publishes into invoice-files, the subscription forwards,
  5. 0:24and the watcher reads invoice-created.
  6. 0:27The channel still has its type from video four, and the receiver gets every invoice.
  7. 0:33This video shapes what the subscription does with the events.
  8. 0:42A filter is the test an event must pass before it flows on.
  9. 0:46The test is a jsonPath of $.invoice,
  10. 0:49and it passes an event when the path matches at least one node of its body.
  11. 0:54The filter is a member of the subscription document.
  12. 0:57Dropped events are counted in the subscription's own log line.
  13. 1:04Add a filter to the subscription file, with that jsonPath.
  14. 1:08Run the document: it applies the change and builds version 0.1.1.
  15. 1:14The run deploys it too, and that puts the filter on the agent.
  16. 1:18The flow is unchanged for now, because every event carries an invoice node.
  17. 1:23Change the source's message to plain text, and run the source again.
  18. 1:29Change the message back, and the invoices flow again.
  19. 1:39While it was plain, the subscription's log line counted each dropped event.
  20. 1:51Add one step to the subscription file, json-deserialize-action.
  21. 1:56A step is a kamelet action under steps, applied in the order listed.
  22. 2:01json-deserialize-action turns a JSON body into fields a later step can address.
  23. 2:08Run the document: it builds the next version, and the deploy puts it live,
  24. 2:14so the step runs before the event reaches the channel.
  25. 2:17The admin UI shows the same document, as boxes in a row.
  26. 2:21It names the source channel, the filter, the step and the channel.
  27. 2:30get eventsubscriptions lists the flow.
  28. 2:33The flow is invoice-files to invoice-created, as it was before.
  29. 2:38The version is the latest, and the state is started in devtest.
  30. 2:46Here is the whole picture.
  31. 2:48The source publishes, the filter keeps the invoices,
  32. 2:52the step turns them into fields, and the channel delivers.
  33. 2:56One filter and one step shaped the flow on the way.

Next in this track

Eventing 6 · 3:20 Dead letters Watched