Search code examples
esperbatchingnesper

Grouping and batching events in Esper


I am trying to group events by User and return them in batches (per user). For example, if 3 users each sent 5 events, I would like 3 batches of 5 events to be output from esper.

Using the following EPL, I am able to validate that 3 data windows are created and that each window has 5 events in it.

select * from EVT.std:groupwin(User).win:time_batch(2).std:size()

However, when I remove std:size() it returns all 15 events in one batch. As I understand it, this is due to how the std:groupwin grouped-window view gets evaluated by the std:merge view.

How can I output the batched events from each data window without them all being merged together?


Solution

  • I think you would like to receive multiple calls to the listener instead of a single call? A single call is generally more efficient so that is the default. I think you want to use "for". The link is http://esper.codehaus.org/esper-5.1.0/doc/reference/en-US/html_single/index.html#epl-grouped-delivery