I try to send an event with the following code but keep receiving it twice in in the registered listener. Is there maybe something wrong with the query in the listener registration or is there some other mistake I made? Thanks for any advise!
System.out.println("test1");
TestEvent event = new TestEvent(foo);
System.out.println("test 1.5");
epService.getEPRuntime().sendEvent(event);
System.out.println("test2");
Listener function
public void update(EventBean[] newEvents, EventBean[] oldEvents) {
LOG.info("TestEvent detected!");
System.out.println("hallo");
}
Log file looks like this:
test1
test 1.5
INFO - TestEvent detected!
hello
INFO - TestEvent detected!
hello
test2
Listener registration:
// Register listener
EPStatement stmt = this.getEPServiceProvider().getEPAdministrator().createEPL("select * from TestEvent");
stmt.addListener(new TestEventListener());