Search code examples
javaapache-stormesper

Storm Esper Bolt Tuple Anchoring


I currently have a topology set up that makes use of an Esper Bolt created by tomdz on GitHub. Everything appears to work fine except when it comes to tuple anchoring.

In the Esper Bolt itself there is a callback:

public void update(EventBean[] newEvents, EventBean[] oldEvents, EPStatement statement, EPServiceProvider epServiceProvider)

The problem here is that I do not have a reference to the previous tuple in the tuple tree. This means when I go to emit my Esper result to the next Bolt in the sequence, I am unable to provide a tuple for anchoring:

collector.emit(new Values(eventName, eventGrouping, eventDescription, correlatedValues));

Wondering if anyone has encountered this issue in their own project? If so how did you get around this? I want to use anchoring to ensure message reliability throughout my topology.


Solution

  • One option is to attach the Storm tuple to the Esper input event as a property and make sure the Esper EPL selects the property either by "select *" or "select originaltuple". The listener can then use that.

    The other option is to track this outside of Esper by using some event id that you may have. Or use the input event identity via identity hashmap mapping the input event to the tuple. The listener would then need to do some lookup based on the Esper input event that is the same reference that Esper also delivers to the listener, and remove.