Skip to content

Resource Event Source for Notification Based External Events #1514

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

Open
csviri opened this issue Oct 4, 2022 · 0 comments
Open

Resource Event Source for Notification Based External Events #1514

csviri opened this issue Oct 4, 2022 · 0 comments

Comments

@csviri
Copy link
Collaborator

csviri commented Oct 4, 2022

For Kubernetes resources we already have this cache in Informer, for external resources we have the CachingInboundEventSource for a resource oriented event coming from an external system. And two flavors of polling event source: PollingEventSource and PerResourcePollingEventSource.

What we don't have covered is the situation for an external resource when it is capable to notify about change, but the notification not contains the resource it self. Typically such external events are comming from AWS resources, like from RDS:
see: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-cloudwatch-events.sample.html
A sample event does not contains the resource itself.
( see also: Event Notification https://martinfowler.com/articles/201701-event-driven.html )

We have two options here either the dependent resource fetches the resource on reconcile and puts it into local cache. Or we prepare an even source that when receives an inbound event also fetches and caches the resource (then triggers and event).
This would be much more optimal, since we just don't fetch resource on every reconcile. So the event source logic should look like this:

sequenceDiagram
    participant InboundFetchingEventSource
    participant ExternalService
    participant EventHandler
    ExternalService->>InboundFetchingEventSource: Send Resource Changed Event
    InboundFetchingEventSource->>ExternalService: Fetch The Whole Resource
    InboundFetchingEventSource->>InboundFetchingEventSource: Cache The Resource
    InboundFetchingEventSource->>EventHandler: Propagate Event About The Change
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant