A subscription binds source to channel
Eventing 3 · 3:57
An event subscription binds one source to one channel, so the source's events reach the integrations that read that channel, with no route to write.
This part of the video couldn't be loaded.
What it covers
- Scaffolding
files-to-invoiceswithweikio init --kind event-subscription - The spec, which refers to the source
invoice-filesand the channelinvoice-created - The watcher's log showing the source's invoices after
weikio run - Retiring the hand-written
invoice-creatorwithweikio undeployandweikio delete integration - The subscription as the only publisher on
invoice-createdinweikio get channels - Checking the binding with
weikio get eventsubscriptionsand in the admin UI
Commands in this video
Terminal
$ weikio init --kind event-subscription files-to-invoices
$ weikio run ./files-to-invoices
$ weikio logs sandbox/invoice-watcher -f --since 10m
$ weikio undeploy sandbox/invoice-creator --env devtest
$ weikio delete integration sandbox/invoice-creator
$ weikio get eventsubscriptions
$ weikio get channelsTranscript
- 0:02An event subscription carries the events of one source into a channel. This
- 0:06video adds a subscription between two channels that don't share events yet.
- 0:14The earlier Eventing videos left these folders on your machine.
- 0:18The event source sends each invoice it brings in onto invoice-files.
- 0:23The watcher reads invoice-created, where nothing from invoice-files arrives yet.
- 0:33weikio init with the event-subscription kind and the name files-to-invoices scaffolds a folder holding a single document,
- 0:41then prints the command to run next.
- 0:44The files-to-invoices folder joins the other three.
- 0:47Your Weik.io installation keeps a block
- 0:50for the subscription beside the source it reads.
- 0:53The project named under the kind, sandbox,
- 0:57comes from the context the Weik.io CLI works in.
- 1:00The spec holds two names,
- 1:02invoice-files to read from and invoice-created to write to.
- 1:10weikio run on files-to-invoices publishes the document, then builds and deploys it.
- 1:18The document declares no version, so this first publish becomes version 0.1.0.
- 1:26The new deployment runs in devtest.
- 1:29The agent starts a Java process per running integration,
- 1:32so the subscription now has one on agent dev.
- 1:38weikio logs for invoice-watcher, following the last ten minutes,
- 1:42prints each invoice as it arrives.
- 1:45Each line is an event the watcher reads off invoice-created.
- 1:49The subscription reads invoice-files through the platform's event-source kamelet.
- 1:54Then the event-sink kamelet writes those events onto invoice-created,
- 1:59with no hand-written route in this flow.
- 2:05The first command, weikio undeploy sandbox/invoice-creator,
- 2:09takes the deployment out of devtest after asking.
- 2:13The creator runs nowhere in devtest now, with its published versions still stored.
- 2:18With nothing deployed, weikio delete integration sandbox/invoice-creator removes the integration with its versions,
- 2:26asking first.
- 2:28The delete cannot be undone.
- 2:30The creator is gone from your machine and from the installation.
- 2:37weikio get channels lists each channel with its publishers and readers.
- 2:43The subscription is the only publisher into invoice-created,
- 2:47with the watcher still its reader.
- 2:52weikio get eventsubscriptions lists every subscription with the source
- 2:56it reads and the channel it writes to.
- 3:00The row carries where the deployment runs, devtest, and its state.
- 3:08The admin UI's Integrations list, narrowed to Event integrations,
- 3:13holds the subscription beside its source.
- 3:16The subscription's Definition page joins the source
- 3:19channel invoice-files to the channel invoice-created.
- 3:26A timer drives the source, so each new invoice lands on invoice-files.
- 3:32The subscription takes those events off invoice-files,
- 3:35then pushes them on to invoice-created.
- 3:39With the creator deleted, the subscription is the only writer onto invoice-created,
- 3:45which the watcher still reads.
Next in this track
Eventing 4 · 3:12 Delivery: give a channel a type Watched