-
Notifications
You must be signed in to change notification settings - Fork 147
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
Find a way to name processed correlation keys #680
Comments
We could also possibly introduce a new |
@ricardozanini @tsurdilo May I proceed with a PR to address that? |
Ideally, we could also take the advantage of that feature to revamp correlation and add support for (discouraged but sometimes necessary) payload based (vs context attributes) correlation: Correlate incoming event of drfined type and source using both (or maybe exclusive too?) event context attributes and payload: events:
- name: correlatedEvent
kind: consumed
type: com.test/cloudevents/test
correlate:
- byContextAttribute:
name: Subject
value: lights-.*
key: lightId
- byPayloadProperty:
property: 'zone' #could also be a runtime expression used to retrieve the property value
key: zoneId |
Finally, to support all use cases, we could also add a Only consume defined event when the condition matches: events:
- name: onTemperatureChanged
kind: consumed
type: com.test/cloudevents/test
condition: '${ .data.heater.isPoweredOn == false }' We would therefore leverage the full power of what we already have and of cloudevents, allowing for extremely complex correlations, which is IMHO one of the core features of the spec. Hell, I came across the spec back in the days because/thanks to cloudevents!!! |
@cdavernas |
Complex event processing scenarios are a widespread use case and a notable research topic called Complex Event Processing. So I'd say we must be aware of that and stay away if possible. Otherwise, we end up writing a specification inside a specification. I'd say that we need some correlation features, but they should be limited. |
@ricardozanini What I'm proposing is, I believe, reasonable and easily implemtable. I agree with @fjtirado, however, that the feature should be optional. It is imho a requirement for (complex, that is more than two even states) event based workflows. |
Ill work on a PR proposal that shapes my ideas as optional add ins to the spec if that ok with you guys |
@cdavernas, absolutely! Nothing against this proposal; we just need to be aware that if we keep adding use cases and features on top of correlations we will build another beast. :D |
@ricardozanini yeah you are right. I'll keep it as concise as possible! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This has been addressed in 1.0.0-alpha1, and is closed as part of #843 |
What would you like to be added:
To allow for a way to name processed correlation keys.
What I propose is to add a new
key
orkeyName
or whatever property to thecorrelationDef
object, so that multiple events can address different correlation keys:Why is this needed:
Consider the following definition:
Image we have a sequential flow such as the following:
What would happen on Synapse is:
I could very easily find a dirty work around that problem, but like I said, it would be dirty. This is, IMO, up to the workflow designer to decide how a newly created correlation key should be named.
Note: not setting the
contextAttributeValue
(and that should be better explained in the spec) basically says that first event to come is gonna set the correlation key based on the defined context attribute (i.e. subject).The text was updated successfully, but these errors were encountered: