How event processors work

A railway with lots of red semaphores.

Here's my understanding of how the sys_trigger "process events" works, also known as the event processor.

Frequently it wakes a Java process that reads the sysevent table.

It looks for events which have no named queue where the process date is in the past which have no "claimed by" yet and are in a state of ready. It orders by "process on" and limits to 100 at a time.

The 100 "oldest" unprocessed events are claimed and a worker start going through them sequentially. As they are completed, the state changes. When all 100 are done, the thread goes back to slep and waits to be woken again by the scheduled job.

Now there are a couple "process event" records. You can also write your own. This community post goes over the items you need;

These sys_trigger records are ephemeral it seems, one runs and it spawns another and the old one is deleted

  1. Trigger the event server-side with a queue;

  2. Insert a new record as a copy of the original "events process" job where you change the script.

    /* from */
    fcScriptName=javascript\\\\:gs.processDelegatedEvents();
    /* to */
    fcScriptName=javascript\\\\:gs.processDelegatedEvents('my_queue_name');
    

Extra Sources