Device Event cleanup task
Is your feature request related to a problem? Please describe.
it would be nice to have a task which removed obsolete Device Events which now makes the dvc_device_event table very big after a while.
This also affects performance of retrieval like shown with issue #2851
Describe the solution you'd like A job which runs periodically and deletes device events which are older than a certain date.
The TTL 90(?) is by account and capped at system level by a property. As a proposal, if a device has less than 100(?) events we will keep them in order to have some history of that device.
This task will run periodically and will keep the device event table with few device events.
Describe alternatives you've considered None
Additional context Work to improve the performance and usability of the platform.
What is your proposal for the implementation of the task? Specifically what interfaces would be best to implement?
Might it be an idea to use/generalize the org.eclipse.kapua.commons.event.HousekeeperRun class and everything around it, or does it have nothing to do with it?
In addition, the atht_access_token table is also affected by the same problem.
However, my proposal would be to parameterize the deletion according to the dvc_device_event.received_on/atht_access_token.expires_on fields, and still maintain a minimum limit of records per device.