Eventing Overview
CloudEvents-based event messaging with NATS JetStream
Weik.io’s eventing system provides CloudEvents-based event messaging using NATS JetStream for event storage and Apache Camel Kamelets for event capture and delivery.
What is Eventing?
Eventing in Weik.io is an event messaging system where all events conform to the CloudEvents specification. Events are captured from external systems, stored in NATS JetStream streams, and delivered to target systems through subscriptions.
Core Components
Events
Events are CloudEvents-compliant messages with standard attributes (type, source, id, time) and event-specific data.
Event Sources
Event Sources capture events from external systems using Apache Camel Kamelets and publish them as CloudEvents to NATS JetStream. Each event source creates 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 Event Sources for configuration reference.
Event Channels
Event Channels deliver CloudEvents to target systems using Apache Camel Kamelets.
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 configuration reference.
Event Subscriptions
Event Subscriptions route events from sources to channels.
Configuration example:
apiVersion: weik.io/v1alpha1
kind: EventSubscription
metadata:
name: s3-to-webhook
spec:
source: s3-events
channel: webhook-channel
See Event Subscriptions for configuration reference.
Streams
NATS JetStream streams provide durable, ordered storage for CloudEvents with configurable retention policies and replay capabilities.
Event Flow
- Event Source captures event from external system
- Event Source publishes CloudEvent to NATS JetStream stream
- Event Subscription reads event from stream
- Event Channel delivers event to target system
Supported Patterns
Publish-Subscribe
Multiple Event Channels can subscribe to the same Event Source. Each subscription creates an independent consumer that receives all events from the source stream.
Event Replay
NATS JetStream streams retain events based on configured retention policies. Events can be replayed from any point in the stream.
Configuration
Event Sources, Event Channels, and Event Subscriptions are configured using YAML files. Configuration supports variable substitution for dynamic values.
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 for configuration management.
What’s Next
- 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