eventing: [Broker/Trigger] Make it easier to consume events directly from specific sources

Problem The current solution involves setting the right attributes on both the source and the triggers. For example:

apiVersion: sources.knative.dev/v1alpha2
kind: PingSource
metadata:
  name: ping-source-1
spec:
  ceOverrides:
    extensions:
      sourceid: ping-source-1
  schedule: "*/1 * * * *"
  jsonData: '{"message": "Hello world! from 1"}'
  sink:
    ref:
      apiVersion: eventing.knative.dev/v1
      kind: Broker
      name: broker
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
  name: trigger-1
spec:
  broker: broker
  filter:
    attributes:
      sourceid: ping-source-1
  subscriber:
    ref:
      apiVersion: v1
      kind: Service
      name: event-display-1

While this solution allows for a trigger to specify that they want events from a specific source, it is quite brittle as there is no way to statically check that the CE extension attribute sourceid matches.

This is a common scenario and Knative Eventing should have a good support for it.

Persona: Which persona is this feature for?

Exit Criteria A measurable (binary) test that would indicate that the problem has been resolved.

Time Estimate (optional): How many developer-days do you think this may take to resolve? 1-2 days?

Additional context (optional) Add any other context about the feature request here.

If you really want: https://github.com/knative/eventing/issues/1381

Possible solutions:

  • From 1381: well-behaved source populate sourceid to be metadata.uid. Trigger supports refing sources.
  • “brokered direct event delivery”: the event source delivers events via a broker

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 18 (15 by maintainers)

Most upvoted comments

Hey sorry to say but your tagging the wrong dug in these issues I’ve never worked with knative in my life and doubt I ever will just so you all know I’m not the person your all probably looking for.