-
Type: Improvement
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 5.4
-
Component/s: None
-
Tags:
-
Upgrade notes:
Async listener should not iterate on events when receiving EventBunde
public void handleEvent(EventBundle events) {
for (Event event : events)
}
For async listener events are ReconnectedEventBundle and iterating on them will reconnect all events, this means opening a session and create document model and context for each event (see ReconnectedEventBundleImpl.getReconnectedEvents())
This is very expensive and useless if the listener is not interested in any event in the bundle.
A first optimisation may be to use containsEventName in the listener to check if the interesting event is present in the bundle,
that should not reconnect any events.