This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push: new 07b8b60 CAMEL-17031 - Performances/Profiling: Avoid boolean allocation in EventHelper (#6194) 07b8b60 is described below commit 07b8b60d9b801f02e6abefb36967dee7cd032a89 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Fri Oct 1 16:49:22 2021 +0200 CAMEL-17031 - Performances/Profiling: Avoid boolean allocation in EventHelper (#6194) --- .../src/main/java/org/apache/camel/support/EventHelper.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/camel-support/src/main/java/org/apache/camel/support/EventHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/EventHelper.java index fbc26ce..9dda3ae 100644 --- a/core/camel-support/src/main/java/org/apache/camel/support/EventHelper.java +++ b/core/camel-support/src/main/java/org/apache/camel/support/EventHelper.java @@ -1302,7 +1302,12 @@ public final class EventHelper { // only notify if notifier is started boolean started = true; if (notifier instanceof StatefulService) { + // only notify if notifier is started (when stateful service) started = ((StatefulService) notifier).isStarted(); + if (!started) { + LOG.debug("Ignoring notifying event {}. The EventNotifier has not been started yet: {}", event, notifier); + return false; + } } if (!started) { LOG.debug("Ignoring notifying event {}. The EventNotifier has not been started yet: {}", event, notifier);