Notifications

958 views

Description

Dedicated Event Processor Use Case and How-To Setup


Most events go into the sysevent table with no queue specified, these events are picked up and processor by the events processors jobs, referred to as general events. Events such the Text Index events text_index are added to the sysevent table with a queue of text_index and these events are processed by the Text Event Processor, these events have a dedicated job process.
 
Benefits
  • This allows for the separation of work
  • A dedicated (worker) isused to processes only the events configured
  • Can be used to help control backlogs caused by slower events.
  • Can be used to better control priority events
Use Case

Use Case: A customer executes a large clean up script or sync job that updates all change requests. As a results there is a large spike in 'ci.affected' events created. This in turn delays all other general event processing, the customer sees the impact as inbound emails 'email.read' events are not updating incident records timely.
 
Solution: Create a Dedicated Event Process job for just email.read events. This solution greatly reduces the chances that email.read events could be delay due to other issues that may be occurring with the instance or the general event queue.

  

How-To Setup

Note: The standard Event Processor uses a delegate model where events are pushed, process and limited to 500 events per node. This method will not do that, when the job starts, 100% of the pending events for that queue will be claimed. This method was not designed to be multiple threaded (multiple jobs).
  1. Login as an Admin account into the instance
  2. Navigate to the System Policy > Registry module.
  3. Filter on the event name, in the use case we used email.read.
  4. Open the record, input the desired queue name under Queue. IE, email.read for the use case. Then save the record.

  1. You can repeat steps 2-4 for any other named events that you want to route to this new dedicated events processor.  For example, you might want to route similar events (such as discovery.device.complete and discovery.complete) to a single event processor.
  2. All newly created events from step 4 now have a queue specified. This is confirmed by going to the System Logs > Events module and filter down matching event name. The specified queue is only added on newly created events

  1. Create the dedicated Event Processor job for the newly created queue by navigating to the System Scheduler > Scheduled Jobs module.
  2. Click the New button.
  3. Enter the following values for the fields and then Click Submit. (Swap out QUEUENAME for the queue name set in step 4) 
Name: QUEUENAME events process
Job Context: fcScriptName=javascript\:GlideEventManager('QUEUENAME').process();
Trigger type: Interval
Repeat: 30 seconds
(Leave all other field as default, in our example we used 'email.read')
 
  1. To verify the new processor is working as expected, navigate to System Logs > Events module and filter down matching event name and confirm that new created events are being marked processed.

 

Validation


Make sure that you validate that everything is working as expected!
  • Check that the newly created events are going into the correct queue
  • Check that the newly created events are being processed
 
 
 

Article Information

Last Updated:2020-04-20 06:27:47
Published:2020-04-20