Skip to content
Weik.ioDocs
2026.1
Try Weik.io

This page describes Weik.io 2026.1, and the current release is 2026.2. Read this topic for 2026.2

Event Subscriptions

Weik.io 2026.1

Connect Event Sources to Event Channels for event routing.

On this page

Event Subscriptions connect Event Sources to Event Channels to route CloudEvents. When you create a subscription, it sets up a NATS JetStream push consumer that automatically forwards CloudEvents from the source’s stream directly to the channel’s subject.

Configuration format#

Event subscriptions are configured using YAML files:

apiVersion: weik.io/v1alpha1
kind: EventSubscription
metadata:
  name: file-webhooksite
  description: Route events from file-watch source to webhook channel
spec:
  source: file-watch-test    # Name of the EventSource
  channel: webhooksite-http  # Name of the EventChannel

Applying configuration#

Use the Weik.io CLI to apply event subscription configurations:

Terminal
weikio config apply filename.yaml

API endpoints#

  1. GET /eventsubscriptions/v2

    • Returns all event subscriptions
    • Requires “EventSubscription.Read” policy
  2. GET /eventsubscriptions/v2/{name}

    • Returns a specific event subscription by name
    • Requires “EventSubscription.Read” policy

How it works#

When an event subscription is configured:

  1. The subscription configuration is stored in the Entity Store
  2. A NATS JetStream push consumer is created:
    • Uses the source’s stream as input (eventsource-{sourceName}-stream)
    • Uses the channel’s subject as deliver subject (eventchannel.{channelName})
    • Has a durable name format: subscription-{name}-durable

Example configuration#

apiVersion: weik.io/v1alpha1
kind: EventSubscription
metadata:
  name: file-webhooksite
  description: Route events from file-watch source to webhook channel
spec:
  source: file-watch-test
  channel: webhooksite-http

This configuration:

  1. Creates a subscription named “file-webhooksite”
  2. Routes CloudEvents from the “file-watch-test” event source
  3. Sends them to the “webhooksite-http” event channel

Integration with other features#

Event Sources#

  • The source specified in the subscription must exist
  • CloudEvents are read from the source’s NATS stream
  • CloudEvents are forwarded without transformation

Event Channels#

  • The channel specified in the subscription must exist
  • CloudEvents are delivered to the channel’s subject
  • The channel handles the delivery to the target system

Next steps#