Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Enable global statement result listeners in Esper
Configuration config = new Configuration();
// must select both streams to get oldEvents as well
config.getEngineDefaults().getStreamSelection().setDefaultStreamSelector(StreamSelector.RSTREAM_ISTREAM_BOTH);
AuditPath.isAuditEnabled = true;
// get serviceProvider and register global statement result listener to get notified of all events created or removed
epService = EPServiceProviderManager.getDefaultProvider(config);
EPServiceProviderSPI spi = (EPServiceProviderSPI) epService;
((MetricReportingServiceSPI)spi.getMetricReportingService()).addStatementResultListener(new StatementResultListener() {
@Override
public void update(EventBean[] newEvents, EventBean[] oldEvents, String statementName, EPStatementSPI statement, EPServiceProviderSPI epServiceProvider) {
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment