Priority Extension

thumbnail
(0)

Version 3.2.0  by WSO2

Category : Siddhi Execution
Supported Product Version : CEP 4.2.0   DAS 3.1.0  

Summary

PriorityStreamProcessor keeps track of the priority of events in a stream.


Associated Tags

Priority-Extension Siddhi

This stream processor requires following three arguments.
  • A unique key variable to identify the event.
  • A priority variable that contains the priority increment.
  • A timeout in constant to decrease the priority by one after the given timeout.

When an event with a new unique key arrives, the PriorityStreamProcessor checks the priority and if the priority is 0, the event is sent without being stored internally.
If an event has a priority greater than 0, it is stored in the Stream Processor, and the current priority is injected into that event.

When an event with the existing priority key arrives, it is stored as a recent event, the priority is increased by the priority of the received event, and the priorityKey and the currentPriority are injected into the event.

After every given timeout, the priority of each event is reduced by 1, and the updated priority is sent out with the last known attributes of those events. This continues until their priority is reduced to 0.

When an event with an existing ID and a large negative priority arrives, the output is 0 and not a negative priority.

Social Sites