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

EnrichmentFunctionWithPeriodicPreloading fires one query per key #2

Open
ena1106 opened this issue May 19, 2021 · 0 comments
Open

EnrichmentFunctionWithPeriodicPreloading fires one query per key #2

ena1106 opened this issue May 19, 2021 · 0 comments

Comments

@ena1106
Copy link

ena1106 commented May 19, 2021

First of all thank you for your webinar, it was really useful!

Please correct me if I'm wrong, but I think the purpose of EnrichmentFunctionWithPeriodicPreloading is to do one call to loadReferenceData() every 1 hour per thread, while now it's one query every 1 hour per thread X key, because processingTimeTimers are per key.
So if you have lots of keys, say lots of different devices sending iot data, you will hit the db many times.

Maybe a timer is useless in this case and we could simply keep track of the last timestamp when loadReferenceData was called and if X time has passed call it again to refresh data (before processing the current element).

Am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant