How to configure StoreFileListener to implement data retention with Chronicle Queue

56 Views Asked by At

From the website , it mentions You can add a StoreFileListener to notify you when a file is added, or no longer used. This can be used to delete files after a period of time. But I don't see any manual regarding how to utilize StoreFileListener or any sample code to implement the data deletion after certain amount of time.

Could you help to provide some guidance? thanks

Sample code with StoreFileListener to delete the data file after certain amount of time

1

There are 1 best solutions below

0
Peter Lawrey On

The StoreFileListener is useful to remove old files almost immediately. If you want to remove them after a few days, I suggest using a cron or system job to find and remove these. Some clients remove them weekly on Sunday morning.