-
Notifications
You must be signed in to change notification settings - Fork 0
Fundamentals
CloudStreams persists cloud events to a global stream used to keep track of all ingested cloud events, regardless of their partition.
A consumer should only subscribe to the global stream (by not setting the partition
) in case of complex filtering requirements, or in case of observability or metric production context.
CloudStreams partitions ingested cloud events into up to 5 different partition types:
-
by-source
: a stream is created for each differentsource
of cloud events consumed by CloudStreams, to allow consumers to query efficiently all the events with a specificsource
context attribute value. -
by-type
: a stream is created for each differenttype
of cloud events consumed by CloudStreams, to allow consumers to query efficiently all the events with a specifictype
context attribute value. -
by-subject
: a stream is created for each differentsubject
of cloud events consumed by CloudStreams, to allow consumers to query efficiently all the events with a specificsubject
context attribute value. -
by-correlation-id
: a stream is created for each different$correlationId
metadata value of cloud events consumed by Cloud Streams, to allow consumers to query efficiently all the events with a specificcorrelationId
metadata value. -
by-causation-id
: a stream is created for each different$causationId
metadata value of cloud events consumed by Cloud Streams, to allow consumers to query efficiently all the events with a specificcausationId
metadata value.
A partition allows consumers to efficiently stream only the specific cloud events they are intested in.
A consumer should only consume the specific cloud events it is interested in, and would typically use a by-type
partition type.
The id
of the partition is the value the cloud events are partitioned by. In the case of a by-type
partition, for example, the id
would be the value of the type
context attributes of all partitioned cloud events.
To subscribe to cloud events ingested by CloudStreams, you need to create a new subscription
resource using the API Server
or the Dashboard
.
The following represents the subscription
resource used to subscribe to all cloud events ingested by CloudStreams, and to dispatch them, at a rate of 1 event every 4 seconds, to an hypothetical webhook.site
consumer:
apiVersion: cloud-streams.io/v1
kind: Subscription
metadata:
name: subscription-1
spec:
subscriber:
uri: https://webhook.site/...
rateLimit: 0.25