Notifications

985 views

Using the Queue Field in the Event Registry | User-Defined Queues

Overview

The Queue field was added to the Event Registry in Berlin to allow users to direct their events to a user-defined queue. User-defined queues separate event processing of your events from baseline queues. Creating your own queue prevents processing delays when baseline queues are busy. For example, if you send your event to the text_index queue, your Priority1Event could theoretically be delayed half an hour while ServiceNow processes 100,000 non-critical text index events created by a data import.

Use this feature only when there is a possibility of long Script Action Processing times or rapid generation of events causing high volumes in the queues.

Procedure

Creating a Queue
  1. Navigate to the Event Registry, System Policy > Events > Registry.
  2. Create a new event.
  3. When configuring the new Event, enter a value in the Queue field. By convention, queue names are all lowercase and use underscores instead of spaces.
  4. Save the event. 

 

Processing the Queue

You must create a Scheduled Job to monitor the user-defined queue for new event entries to be processed.

  1. Navigate to System Scheduler > Scheduled Jobs > Scheduled Jobs.
  2. Open the text index events process Scheduled Item and make the following modifications:
    1. Change the name.
    2. In the Job context field locate the GlideEventManager method call and replace the string text_index with the name of your new queue.
    3. Decide if legacy or delegated events processor should be used.
      1. For the legacy processing, no additional changes are needed to the job.
      2. If the events in this queue can be processed delegated, change the GlideEventManager method from process() to processDelegatedEvents(). Change also the system_id to "Active nodes". Validate that the new events processors jobs are created and their records are present in the [sys_event_processor] table.

Example of job context for delegated events processing:

GlideEventManager("<queue>").processDelegatedEvents();

OR Legacy:

GlideEventManager("<queue>").process()

  1. Right-click on the Schedule Item header and select Insert and Stay.
    Important:  Do NOT overwrite the baseline text index events process Scheduled Job.

 

Generating the Event

Generate the event with the gs.eventQueue() method as usual. No special consideration or parameters are required for sending an event to a specific queue as this is determined by the Registry.

Determining which Queue an Event is In
  1. Navigate to System Policy > Events > Event Log.
  2. Locate your Event and scroll to the Queue column.
    If there is a value in the Queue field, the event went to a Queue other than the default queue. If the Queue field is blank, the event was sent to the default queue.

 

Article Information

Last Updated:2018-05-24 13:12:25
Published:2018-05-24