A subscription binds source to channel
Eventing 3 · 3:16
An event subscription binds one source to one channel, so events from an event source reach the integrations that read that channel. The platform builds the route itself.
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 channel's one producer and one reader in
weikio 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:02In video two, an event source published into its own channel.
- 0:06An event subscription binds one source to one channel, and the events flow on.
- 0:16In video two, the source invoice-files published into its own channel.
- 0:21The watcher from video one reads invoice-created, and nothing binds the two.
- 0:32The binding is an event subscription, the fourth folder on your machine.
- 0:37weikio init --kind event-subscription writes it, named files-to-invoices.
- 0:42The file names its kind, event-subscription, and its project,
- 0:47sandbox, taken from the context.
- 0:50Its spec fills in the two names:
- 0:52source, invoice-files, and channel, invoice-created.
- 0:57One document, written once, holds the whole binding.
- 1:04Run publishes the document as version 0.1.0,
- 1:08and its row names the flow: invoice-files to invoice-created.
- 1:16Once its deployment runs, every invoice the source publishes flows on.
- 1:23The watcher's log now shows every invoice the source published.
- 1:27One event moved from invoice-files to invoice-created,
- 1:31and the log line is the proof.
- 1:33Nothing in the flow was written by hand: the platform built the route.
- 1:42The hand-written publisher retires,
- 1:44and the undeploy takes sandbox/invoice-creator out of devtest.
- 1:49The delete then removes sandbox/invoice-creator,
- 1:53which runs nowhere, with its version.
- 1:55With it gone, the source is the channel's one producer.
- 2:03Get channels shows it: invoice-files publishes into invoice-created,
- 2:08and the watcher reads it.
- 2:10One producer, one reader: every event on invoice-created is the source's.
- 2:18Get eventsubscriptions lists the binding, with its source and its channel.
- 2:23Its one row shows source, channel, latest version and deployments.
- 2:33The admin UI lists it under Event integrations, beside the source.
- 2:38Its page shows the binding: source channel invoice-files to channel invoice-created.
- 2:48Here is the whole picture.
- 2:49The timer reads its system, and the source publishes into invoice-files.
- 2:54The subscription reads invoice-files and publishes into invoice-created, on the way.
- 3:02The hand-written publisher is gone, and the source is the one producer.
Next in this track
Eventing 4 · 2:59 Delivery: give a channel a type Watched