This is the consumer side of #814
When consuming events from Knative Eventing today, those events are consumed from a Channel by creating a Subscription. An example:
apiVersion: eventing.knative.dev/v1alpha1
kind: Subscription
metadata:
name: cronjob-source-sample
spec:
channel:
apiVersion: eventing.knative.dev/v1alpha1
kind: Channel
name: testchannel
subscriber:
ref:
apiVersion: serving.knative.dev/v1alpha1
kind: Service
name: message-dumper
This requires making a decision every time a subscription - what Channel should this consume events from and do I need to create that Channel?
What's lacking is a way to consume events from Knative Eventing without having to make a decision about how that event was produced or routed. Instead, I'd like to consume events from based on the CloudEvents attributes or body of that event - source, type, fields within the body, etc.
Something like this:
apiVersion: eventing.knative.dev/v1alpha1
kind: Subscription
metadata:
name: cronjob-source-sample
spec:
filter:
type: 'dev.knative.cronjob.event'
subscriber:
ref:
apiVersion: serving.knative.dev/v1alpha1
kind: Service
name: message-dumper
Or, if we have some concept of a well-known and statically named event Bucket (naming TBD, also referred to as Broker or Router) then something like:
apiVersion: eventing.knative.dev/v1alpha1
kind: Subscription
metadata:
name: cronjob-source-sample
spec:
bucket:
apiVersion: eventing.knative.dev/v1alpha1
kind: Bucket
name: default
filter:
type: 'dev.knative.cronjob.event'
subscriber:
ref:
apiVersion: serving.knative.dev/v1alpha1
kind: Service
name: message-dumper
See Knative Eventing use cases and product requirements - 2019 and Broker and Trigger for some prior discussion and ideas around these topics. Those docs should be visible to anyone in the knative-users Google Group.
This is the consumer side of #814
When consuming events from Knative Eventing today, those events are consumed from a
Channelby creating aSubscription. An example:This requires making a decision every time a subscription - what
Channelshould this consume events from and do I need to create thatChannel?What's lacking is a way to consume events from Knative Eventing without having to make a decision about how that event was produced or routed. Instead, I'd like to consume events from based on the CloudEvents attributes or body of that event -
source,type, fields within the body, etc.Something like this:
Or, if we have some concept of a well-known and statically named event
Bucket(naming TBD, also referred to asBrokerorRouter) then something like:See Knative Eventing use cases and product requirements - 2019 and Broker and Trigger for some prior discussion and ideas around these topics. Those docs should be visible to anyone in the knative-users Google Group.