IBM Support

Removing duplicate event records from EventQueue with UpdateEventQueue

Question & Answer


Question

Prevent multiple reprocessing of events by removing copies built up in EventQueue.

Cause

In situations where the EventReader can build up a backlog of events (for example: heavy load) there is the potential for the EventReader to recapture the same event multiple times. These are held in the EventReader EventQueue and can lead to unwanted multiple reprocessing of the same event.

Answer

The UpdateEventQueue() function of Impact Policy Language can assist in handling this situation.

The most common action is to use this function to remove any copies of the event currently being processed from the EventQueue. This is achieved by identifying the EventQueue by the name of the EventReader and the event by a unique field value (for example: Identifier) or combination of field values and setting the IsDelete Boolean parameter to True. For example:

    WP = "RemoveDuplicates";
    Log(2,ID+WP);
    EventReaderName = "OMNIbusEventReader";
    Filter = "Identifier = '"+ @Identifier +"'";
    IsDelete = True;

    NumDeletedEvents = UpdateEventQueue(EventReaderName, Filter, NULL, IsDelete);
    Log(3,ID+WP+" Number of duplicate events deleted from EventQueue: "+NumDeletedEvents);

The above example employs a style of logging espoused in the TechNote "Structured logging in Policies" [link below].

When utilised with a flag field to indicate that an event is currently being processed, this tool can prevent the majority of situations that lead to unwanted multiple reprocessing of events. For example:

    ID = "ID_"+ @Serial +"_"+ @StateChange +": ";
    WP = "Start";
    Log(1,ID+WP);

    WP = "RemoveDuplicates";
    Log(2,ID+WP);
    EventReaderName = "OMNIbusEventReader";
    Filter = "Identifier = '"+ @Identifier +"'";
    IsDelete = True;

    NumDeletedEvents = UpdateEventQueue(EventReaderName, Filter, NULL, IsDelete);
    Log(3,ID+WP+" Number of duplicate events deleted from EventQueue: "+NumDeletedEvents);

    WP = "MarkEventImpacting";
    Log(2,ID+WP);
    @ImpactFlag = 2;
    Log(3,ID+WP+": @ImpactFlag"+@ImpactFlag);

Please see the TechNotes "Event flagging" [link below] and "Avoiding unwanted event reprocessing" [link below].

Please also see the TechNotes "Event Flagging with Go_NoGo checking" [link below] and "Using EventLocking to help prevent multiple event reprocessing" [link below].

[{"Product":{"code":"SSSHYH","label":"Tivoli Netcool\/Impact"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Netcool\/Impact","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"}],"Version":"6.1;6.1.1;7.1.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
17 June 2018

UID

swg21675016