-
Notifications
You must be signed in to change notification settings - Fork 6
Heads-up: potential issue with use of "source" in filters? #74
Comments
Next step: I need to better structure these ideas in a proposal we can discuss as a group (in progress). |
I wonder if Timur this is kind of what you're pointing to in this issue: triggermesh/triggermesh#1145 |
triggermesh/triggermesh#1145 suggests a couple of event dispatcher updates that would definitely extend our abilities to control event attributes, and possibly improve routing options. But I haven't thought thoroughly about how exactly we could employ these attributes yet. Regarding the rest, I'm not 100% sure that I understand the idea, let me try to clarify it: |
Yes, that was my concern, you've made it clear that a CloudEvent What I'm thinking for the registry is that something like Then, I would use those values in my Trigger filters: So having a different name to reference the source component could certainly help disambiguate. I don't have an opinion right now on what the best alternative name would be though. |
After a quick re-think on this, long term I still think CloudEvents and their parameters (source, type, id, time, extensions, ...) are/should be first class concepts that the user manipulates and could use in the definition of a trigger filter from tmctl. This is possible today, but there is a conflict because I can do something like this:
where the Possible paths are:
Low priority right now IMO but worth keeping open. |
I'm calling this a heads-up because I'd like to finish the proposal for event registry to properly explain.
But the basic idea is I think we need to clarify what an
event
is from the user's perspective (and document it in our docs etc) and am thinking we could more explicitly align with CloudEvents, and include the event'ssource
andtype
as attributes the user knows about and can manipulate.Current behaviour
Currently, the CLI seems to match the value of
source
with the name of the source component, so if I create a source calledfoo-webhooksource
, then I can create a Trigger with--source foo-webhooksource
.Potential issue
To illustrate, does this fall apart when I'm using a CloudEvents source? With CloudEvents source, I can define the type and source of my event at runtime as an attribute in the context metadata, e.g.
type = mycustomtype
andsource = mycustomruntimesource
. And then I might want to filter on this source value in a Trigger, not the name of the CloudEventsSource component I created. E.g.:BTW I still get an issue when trying to use the source component name:
So essentially, maybe
source
is not the name of the source component, but something that more generally describes what external system the event came from.So as a user, if I start working with a Broker locally and I know there are events coming from Salesforce, I can lookup the value of
source
for events coming from Salesforce in the Registry. This would be independent of the name of the SalesforceSource component being used. That means my definitions of Triggers and Rules aren't coupled to component names, but to Event types and schemas, events being the "contract" between producer and consumer.In terms of the "default events schemas" that TriggerMesh knows about (e.g. that Fran is adding in the CRDs), we could also hardcode a value for
source
when it makes sense, alongside thetype
anddescription
and payloadschema
as he has started doing. So e.g. for SQS, we could have the following predefined schema:The text was updated successfully, but these errors were encountered: