Eventing Overview
CloudEvents-based event messaging with NATS JetStream
Weik.io’s eventing system standardizes event messaging on CloudEvents. NATS JetStream stores the events, and Apache Camel Kamelets move them between systems.
What is eventing?
Weik.io routes events through a central messaging backbone instead of point-to-point connections. External systems push data in, Weik.io converts it to the CloudEvents standard, stores it in NATS JetStream, and delivers it to subscribers. This follows a standard publish-subscribe model, with CloudEvents enforced throughout to keep events consistent and easier to debug.
Core components
Events
Every message moving through the system is a CloudEvent. You always get a predictable envelope with standard attributes—such as type, source, id, and time—wrapped around your actual data.
Event Sources
Event Sources are where data enters the system. They use Apache Camel Kamelets to connect to external APIs, databases, or message brokers. Once data arrives, the source converts it to a CloudEvent and publishes it to a dedicated NATS JetStream stream.
Configuration example:
apiVersion: weik.io/v1alpha1
kind: EventSource
metadata:
name: s3-events
spec:
type: aws-s3-source
parameters:
bucketNameOrArn: "my-bucket"
region: "eu-west-1"
See the Event Sources reference for the available connectors.
Event Channels
Event Channels deliver data out of the system. They take CloudEvents and use Camel Kamelets to deliver them to external targets.
Configuration example:
apiVersion: weik.io/v1alpha1
kind: EventChannel
metadata:
name: webhook-channel
spec:
type: http
parameters:
url: "https://example.com/webhook"
method: "POST"
See Event Channels for the full list of delivery options.
Event Subscriptions
Sources and channels are independent of each other. Event Subscriptions connect them by routing events from a specific source to a specific channel.
Configuration example:
apiVersion: weik.io/v1alpha1
kind: EventSubscription
metadata:
name: s3-to-webhook
spec:
source: s3-events
channel: webhook-channel
See Event Subscriptions for more details.
Streams
NATS JetStream stores the events in a durable, ordered log. If a target system goes down, the events wait in the stream until they can be delivered.
Event flow
Events move through the system in four steps:
- An Event Source reads data from an external system.
- It publishes a CloudEvent to a NATS stream.
- An Event Subscription picks up the event.
- An Event Channel pushes it to the target system.
Supported patterns
Publish-subscribe
You can attach multiple channels to a single source. Each subscription gets its own consumer, so one slow target does not block other systems from receiving the same event.
Event replay
Because NATS keeps a record, you can replay events from the past. If a downstream system loses data, you can replay the stream from an earlier point to recover it.
Configuration
You configure these components with YAML. Weik.io supports variable substitution so you do not have to hardcode secrets in YAML files.
Example with variables:
apiVersion: weik.io/v1alpha1
kind: EventSource
metadata:
name: s3-events
spec:
type: aws-s3-source
parameters:
accessKey: "{{accessKey}}"
secretKey: "{{secretKey}}"
variables:
- accessKey: "{{sys:AWS_ACCESS_KEY}}"
- secretKey: "{{sys:AWS_SECRET_KEY}}"
See Variables to learn how to manage secrets safely.
Next steps
- Events - View and manage events
- Streams - Configure event streams
- Event Sources - Capture events from systems
- Event Channels - Deliver events to destinations
- Event Subscriptions - Route events through your system