Skip to content

Instantly share code, notes, and snippets.

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
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() {
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