Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger: add customized fields into cloudevent extension after the event passes a trigger filter #7704

Open
xiaoajlszt opened this issue Feb 20, 2024 · 3 comments
Labels
area/brokers area/channels kind/feature-request triage/needs-user-input Issues which are waiting on a response from the reporter

Comments

@xiaoajlszt
Copy link

xiaoajlszt commented Feb 20, 2024

Problem
broker --> trigger1 --> app --> ...
--> trigger2 --> app --> ...
--> trigger3 --> app --> ...

Similar to the event delivery process above, since we reuse apps (three apps are actually one app), we need to know the location of the event (that is, which app in the workflow) based on some fields in the event. Then we obtain the corresponding configuration according to the location to process the event, and continue to deliver the event.

So I hope to add customized fields into cloudevent extension after the event passes a trigger filter. Maybe You can add a kv map in the trigger spec. thx!

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?

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

@pierDipi
Copy link
Member

For sources, we have something similar to what you're describing https://knative.dev/docs/eventing/sources/apiserversource/reference/#cloudevent-overrides but it's not based on some fields in the event.

Can you expand a bit more on the based on some fields in the event with a few examples?

@pierDipi pierDipi added area/channels area/brokers triage/needs-user-input Issues which are waiting on a response from the reporter labels Feb 20, 2024
@xiaoajlszt
Copy link
Author

For example, when we handle an abnormal event, we usually need to go through multiple processing steps, which form a workflow.

We may reuse some steps (these steps are run by the same pod, while each step has its own configuration).

During the delivery of events, we save the current step's position(in the workflow) in the cloudevent extension, and the pod can obtain the configuration of current step by the position in the cloudevent.

@Cali0707
Copy link
Member

Cali0707 commented May 8, 2024

Hey @xiaoajlszt - in your use case, do you send the new event back to the broker by replying to the original request sent from the trigger, or is it a fully new request to the broker?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/brokers area/channels kind/feature-request triage/needs-user-input Issues which are waiting on a response from the reporter
Projects
None yet
Development

No branches or pull requests

3 participants