An event source brings events in
Eventing 2 · 3:17
An event source brings events from a system outside the platform into a channel of its own name. One YAML document is the whole source, and the platform runs it like any integration.
What it covers
- Scaffolding an event source document with
weikio init --kind event-source - Giving each event a body with the
messageparameter - Publishing and starting the source with
weikio run - The
invoice-fileschannel and its stored events inweikio events list - The source's version and definition with
weikio get eventsourcesandweikio describe - The source under Event integrations on the admin UI's Integrations page
Commands in this video
Terminal
$ weikio init --kind event-source invoice-files
$ weikio run ./invoice-files
$ weikio events list sandbox/invoice-files
$ weikio get channels
$ weikio get eventsources
$ weikio describe integration sandbox/invoice-filesTranscript
- 0:02An event source reads a system outside the platform, through a source kamelet.
- 0:07What it reads, it publishes into a channel of its own name.
- 0:14In video one, both sides of the channel were hand-written integrations.
- 0:19The creator still publishes its timer events, and the watcher still reacts.
- 0:27An event source is a document. weikio init --kind event-source writes it.
- 0:34The file names its kind, event-source, and its project,
- 0:38sandbox, taken from the context.
- 0:41One YAML file, run like any other document the hub stores.
- 0:45The spec's own example is a timer that publishes every sixty seconds.
- 0:52One edit gives each event a body, the message parameter.
- 1:05Run publishes the document as version 0.1.0 and starts its deployment.
- 1:12A source is an integration like any other,
- 1:14built and started with a version of its own.
- 1:17Its timer publishes one invoice every sixty seconds, and the platform stores it.
- 1:25The channel holds the events. weikio events list takes its name.
- 1:30One row per publish, with sandbox/invoice-files under SOURCE.
- 1:35Each carries a seq, the number the row is found by.
- 1:40The channel invoice-files was never created.
- 1:43The source's own document declares the channel,
- 1:47and the channel carries the source's name.
- 1:52The kamelet it reads through is timer-source,
- 1:55the platform's name for the document's type.
- 2:01Get eventsources lists the source, with its version and its deployment.
- 2:06Its one row shows the type, timer, and its latest version.
- 2:11A source has versions, deployments and a definition, like any integration.
- 2:17Describe shows the document's own fields under Definition, the body among them.
- 2:27The admin UI lists it on the Integrations page, under Event integrations.
- 2:32The same list, narrowed to the Event integrations, shows the source.
- 2:38Its page names the kamelet and the channel, the document's facts.
- 2:47Here is the whole picture.
- 2:49The document's timer reads its system through the timer kamelet.
- 2:54The source publishes what it reads into its own channel.
- 2:57The channel holds the events, and the invoice-created channel is waiting.
- 3:02In video three, a subscription binds this source to that channel.
Next in this track
Eventing 3 · 3:16 A subscription binds source to channel Watched