Managing events order within operations
About this task
When processing a stream of events, it is not guaranteed that the order in which events arrive at the processing step is the same as the order in which the events occurred.
Consequently, this may cause problems regarding the completeness of the aggregation operations.
For instance, if you have an aggregation that requires receiving several input events before the end condition, the operation may end prematurely if the end event arrives earlier than expected. In this case, the aggregation will provide an incomplete result.
One solution to overcome this problem is to use a delay property, defined as the delay in milliseconds that the processing application must respect after the completion condition becomes true, before completing the operation and considering the summary as completed. A good value for the delay would be the upper bound of the events latency.