Hi

Is there a problem if you have 2 camel routes using the same zookeeper
endpoint, and each route have their own zookeeper producer. And now
you shutdown one of the routes, so the other route is still running.

If the producer now stops a shared zkm, then the running routes will fail.

Just wondering if we now have such a problem?

On Fri, Dec 20, 2013 at 12:30 PM,  <ningji...@apache.org> wrote:
> Updated Branches:
>   refs/heads/master fdb19f5d1 -> ab39bdab3
>
>
> ZooKeeperProducer should shutdown the ConnectionManager when it is closed 
> with thanks to Klaus
>
>
> Project: http://git-wip-us.apache.org/repos/asf/camel/repo
> Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5c184f93
> Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5c184f93
> Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5c184f93
>
> Branch: refs/heads/master
> Commit: 5c184f93dea63c8eddc78088a7c074ff1ea2b5bd
> Parents: fdb19f5
> Author: Willem Jiang <willem.ji...@gmail.com>
> Authored: Fri Dec 20 19:26:02 2013 +0800
> Committer: Willem Jiang <willem.ji...@gmail.com>
> Committed: Fri Dec 20 19:26:02 2013 +0800
>
> ----------------------------------------------------------------------
>  .../apache/camel/component/zookeeper/ZookeeperProducer.java | 9 +++++++++
>  1 file changed, 9 insertions(+)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/camel/blob/5c184f93/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZookeeperProducer.java
> ----------------------------------------------------------------------
> diff --git 
> a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZookeeperProducer.java
>  
> b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZookeeperProducer.java
> index 4edc98e..f3e77d9 100644
> --- 
> a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZookeeperProducer.java
> +++ 
> b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZookeeperProducer.java
> @@ -101,6 +101,15 @@ public class ZookeeperProducer extends DefaultProducer {
>          }
>      }
>
> +    @Override
> +    protected void doStop() throws Exception {
> +        super.doStop();
> +        if (log.isTraceEnabled()) {
> +            log.trace(String.format("Shutting down zookeeper producer of 
> '%s'", configuration.getPath()));
> +        }
> +        zkm.shutdown();
> +    }
> +
>      private void asynchronouslyDeleteNode(ZooKeeper connection, 
> ProductionContext context) {
>          if (log.isDebugEnabled()) {
>              log.debug(format("Deleting node '%s', not waiting for 
> confirmation", context.node));
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Reply via email to