Search code examples
javaespercomplex-event-processing

Esper: Get name/user object of statement inside the listener update method


I'm attempting to build an application that dynamically creates and destroys EPStatements at runtime, the listener is set to send an e-mail whenever a statement matches on the data stream. The recipient(s) of that e-mail may change based on which statement matched.

Therefore, I have an UpdateListener in Esper that is listening to multiple EPStatements. Is there any way for me to figure out which of the multiple EPStatements sent the data to the update method so that it will know where to send the e-mail?

Thanks in advance for your help.


Solution

  • You can use the StatementAwareUpdateListener which provides the EPStatement as well.