knative / knative/eventing

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

Open
#4,486 19 comments 0 reactions 0 assignees View on GitHub
area/ux-decision kind/feature-request priority/important-longterm triage/accepted
Dominant language
Go
Stars
1.6k
Forks
631
Avg merge
2d 1h
Merged PRs (30d)
6

Description

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

```yaml
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
```

```yaml
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:](https://github.com/knative/eventing/blob/master/docs/personas.md)**
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

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the two possible approaches linked from issue 1381 and the Broker/Trigger behavior described here. Define a binary exit test for consuming events from a specific source, then evaluate it against the provided PingSource and Trigger scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.