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

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new cd0d07d  CAMEL-12418: High CPU load on events watching (#2283)
cd0d07d is described below

commit cd0d07d1745cbf153881160d73e28b2abc240ebb
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Wed Apr 18 09:38:04 2018 +0200

    CAMEL-12418: High CPU load on events watching (#2283)
---
 .../camel/component/consul/endpoint/ConsulEventConsumer.java  | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/components/camel-consul/src/main/java/org/apache/camel/component/consul/endpoint/ConsulEventConsumer.java
 
b/components/camel-consul/src/main/java/org/apache/camel/component/consul/endpoint/ConsulEventConsumer.java
index 7133fec..b74615b 100644
--- 
a/components/camel-consul/src/main/java/org/apache/camel/component/consul/endpoint/ConsulEventConsumer.java
+++ 
b/components/camel-consul/src/main/java/org/apache/camel/component/consul/endpoint/ConsulEventConsumer.java
@@ -30,19 +30,18 @@ import com.orbitz.consul.option.QueryOptions;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.Processor;
-import org.apache.camel.spi.ExecutorServiceManager;
 import org.apache.camel.component.consul.ConsulConfiguration;
 import org.apache.camel.component.consul.ConsulConstants;
 import org.apache.camel.component.consul.ConsulEndpoint;
+import org.apache.camel.spi.ExecutorServiceManager;
 
 public final class ConsulEventConsumer extends 
AbstractConsulConsumer<EventClient> {
-    private ExecutorServiceManager executorServiceManager;
+    private final ExecutorServiceManager executorServiceManager;
     private ScheduledExecutorService scheduledExecutorService;
 
     public ConsulEventConsumer(ConsulEndpoint endpoint, ConsulConfiguration 
configuration, Processor processor) {
         super(endpoint, configuration, processor, Consul::eventClient);
         this.executorServiceManager = 
endpoint.getCamelContext().getExecutorServiceManager();
-        this.scheduledExecutorService = 
this.executorServiceManager.newSingleThreadScheduledExecutor(this, 
"ConsulEventConsumer");
     }
 
     @Override
@@ -51,6 +50,12 @@ public final class ConsulEventConsumer extends 
AbstractConsulConsumer<EventClien
     }
 
     @Override
+    protected void doStart() throws Exception {
+        super.doStart();
+        this.scheduledExecutorService = 
this.executorServiceManager.newSingleThreadScheduledExecutor(this, 
"ConsulEventConsumer");
+    }
+
+    @Override
     protected void doStop() throws Exception {
         executorServiceManager.shutdownGraceful(scheduledExecutorService);
         super.doStop();

-- 
To stop receiving notification emails like this one, please contact
davscl...@apache.org.

Reply via email to