-
Notifications
You must be signed in to change notification settings - Fork 229
Use eventsource for secondary resource by default #2968
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
Use eventsource for secondary resource by default #2968
Conversation
2c662f0
to
c885980
Compare
c885980
to
cc462c2
Compare
This is a bot problematic, since the target event source could still hold multiple resources for this type. Line 140 in 7397be6
|
Note that the current design check on |
Got it - digging a little deeper with your hint made me understand how it's supposed to work. Thanks a lot! |
The current design is wrong because it will never properly match resources that need to be updated even if |
My issues here were caused by my Kotlin runtime not enforcing checked exceptions, see #2965 @metacosm you're right, while a secondary resource is not reconciled it will not be returned by this method. Might be intentional though - I've not yet gotten deep enough into this. On the plus side, Kotlin DataClasses already implement a clean equals/hashcode for my external secondary resource type so I got that covered at least. |
@florianknecht Line 137 in 9158b8e
|
@florianknecht |
But the current approach is also functional, I don't see it broken. The API might be more elegant, though. |
Have you tested with a scenario where the dependent resource needs to be updated (i.e. the current state doesn't match the desired state)? |
That dependent resources is NOT an Lines 47 to 49 in 75405bf
|
AbstractEventSourceHolderDependentResource may have the current state of the dependent resource in its event sources cache. Let's use that by default.
Otherwise the super implementation in AbstractDependentResource runs empty via context.getSecondaryResources, never looking for information in the event source's cache. Which forces all inheritors to implement this lookup themselves (e.g. PerResourcePollingExternalDependentResource, where I noticed this).