Hi, Sorry for the delayed response.
As per the existing implementation, we cannot achieve your requirement with sort window due to two reasons. 1) We cannot alter the value of an event which has already been consumed by a stream. Therefore, we can't change the value of event (id: 3, score: 30) to (id: 3, score: 5) later. When you send another event as (id: 3, score: 5) it would be considered as a new event. Hence, it doesn't replace (id: 3, score: 30) 2) The sort window mandates specifying a window length. Therefore we can't retain the events forever as necessitated to achieve your requirement. Therefore, if you need to perform sorting by considering all the events, you would have to write a new extension, The syntax could be similar to the existing sort window. However, internally, you would have to maintain a hash map of values, so that for the incoming events, you can update the map based on the value for the ID (whatever the attribute(s) you use for indexing). And sorting would have to be performed on the values in that map Thank you Charini -- *Charini Vimansha Nanayakkara* Software Engineer at WSO2 Mobile: 0714126293 E-mail: [email protected] Blog: http://www.charini.me/ <http://wso2.com/signature>
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
