Effect of OnSuccess card setting on file event triggers
The OnSuccess card setting can affect performance when an input file is a source event in a Launcher system.
The Launcher file listener maintains and monitors a list of the files that have triggered the Launcher to run a map. Each time the file listener receives an input file candidate for the Launcher, it compares the input file's name and timestamp against the list before it notifies the Launcher of the file.
- Files that have the OnSuccess=Keep card setting remain on the list after triggering an event.
- Files that have the OnSuccess=KeepOnContent card setting remain on the list after triggering an event if the file is not empty.
- Files that have the OnSuccess=Delete card setting are removed from the list after triggering an event.
Over time, files that have the OnSuccess=Keep card setting cause the list to grow. A longer file list takes the file listener longer to traverse and maintain, which affects the performance of the Launcher. In production environments that use the Launcher, either set the OnSuccess card setting to Delete, or configure a keep directory.
When the Launcher OnSuccess setting specifies Keep or KeepOnContent, the File adapter can move the source-event file to a keep directory when a map succeeds. A default keep directory is always available when cooperative file listening is enabled in the config.yaml file. When cooperative file listening is disabled, a keep directory is available only if you configure it in the Launcher settings. By using a keep directory, you can retain a source-event file without affecting the performance of the file listener.