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
commit a40c1456fa2c360bee0512c9d5647a8be2c701c2 Author: Claus Ibsen <[email protected]> AuthorDate: Mon Jun 14 09:36:19 2021 +0200 CAMEL-16711: components - Move OSGi dependenct code to camel-karaf --- .../component/zookeepermaster/ZookeeperGroupSupport.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/ZookeeperGroupSupport.java b/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/ZookeeperGroupSupport.java index ec1f73e..14215bb 100644 --- a/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/ZookeeperGroupSupport.java +++ b/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/ZookeeperGroupSupport.java @@ -175,10 +175,16 @@ public class ZookeeperGroupSupport extends ServiceSupport } } if (managedGroupFactory == null) { - if (managedGroupFactoryStrategy == null) { - managedGroupFactoryStrategy = new DefaultGroupFactoryStrategy(); + Set<ManagedGroupFactoryStrategy> set + = getCamelContext().getRegistry().findByType(ManagedGroupFactoryStrategy.class); + if (set.size() == 1) { + setManagedGroupFactoryStrategy(set.iterator().next()); + } else { + setManagedGroupFactoryStrategy(new DefaultGroupFactoryStrategy()); } - setManagedGroupFactory(managedGroupFactoryStrategy.createGroupFactory(curator, getClass().getClassLoader(), + } + if (managedGroupFactory == null) { + setManagedGroupFactory(getManagedGroupFactoryStrategy().createGroupFactory(curator, getClass().getClassLoader(), getCamelContext(), this)); } }
