2012-03-13 25 views
0

我使用Nesper(4.1.2/4.5.0),並且遇到問題:使用分組子句時事件未傳遞給訂戶。Esper:使用分組子句時事件不會傳遞給訂戶

EPL查詢:

select Operation, count(*) as OperationCount from OperationEvent.win:time(10 sec) group by Operation

最後輸出每5秒

用戶

public void Update(IDictionary<string, object>[] insertStream, IDictionary<string, object>[] removeStream) 
{ ... } 

當我一條一條地刪除組,然後一切工作不錯。

出了什麼問題?

回答

0

我解決了我的問題。當我在AddEventType方法中添加地圖而不是類型時,所有方法都正確無誤。我將事件作爲地圖發送(IDictionary <>),而不是對象。

正確的解決方案:

var map = eventType.GetProperties(BindingFlags.Instance | BindingFlags.Public).ToDictionary(property => property.Name, property => (object) property.PropertyType);

_epService.EPAdministrator.Configuration.AddEventType(eventType.Name, map);