This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch camel-3.11.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.11.x by this push:
     new fba8494  CAMEL-17031 - Performances/Profiling: Avoid boolean 
allocation in EventHelper (#6194)
fba8494 is described below

commit fba8494ac55116a5776253d1b3af6d1eda399d3e
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);

Reply via email to