Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D02EC200D0E for ; Tue, 26 Sep 2017 16:31:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CCEFB1609C1; Tue, 26 Sep 2017 14:31:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1ED881609B4 for ; Tue, 26 Sep 2017 16:31:17 +0200 (CEST) Received: (qmail 75654 invoked by uid 500); 26 Sep 2017 14:31:17 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 75640 invoked by uid 99); 26 Sep 2017 14:31:16 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Sep 2017 14:31:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B85F5F330D; Tue, 26 Sep 2017 14:31:16 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: lburgazzoli@apache.org To: commits@camel.apache.org Message-Id: <050e0ccc2ddc424ead471b70396de780@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: camel git commit: camel-atomix: improve spring boot conditions Date: Tue, 26 Sep 2017 14:31:16 +0000 (UTC) archived-at: Tue, 26 Sep 2017 14:31:19 -0000 Repository: camel Updated Branches: refs/heads/master 0620b0772 -> cf77381a4 camel-atomix: improve spring boot conditions Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cf77381a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cf77381a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cf77381a Branch: refs/heads/master Commit: cf77381a441c9573f58dccc7ff3dcb57238e21d1 Parents: 0620b07 Author: lburgazzoli Authored: Tue Sep 26 16:30:35 2017 +0200 Committer: lburgazzoli Committed: Tue Sep 26 16:31:11 2017 +0200 ---------------------------------------------------------------------- .../ha/springboot/AtomixClusterServiceAutoConfiguration.java | 3 +++ 1 file changed, 3 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/cf77381a/platforms/spring-boot/components-starter/camel-atomix-starter/src/main/java/org/apache/camel/component/atomix/ha/springboot/AtomixClusterServiceAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-atomix-starter/src/main/java/org/apache/camel/component/atomix/ha/springboot/AtomixClusterServiceAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-atomix-starter/src/main/java/org/apache/camel/component/atomix/ha/springboot/AtomixClusterServiceAutoConfiguration.java index 7d7c6cd..286918f 100644 --- a/platforms/spring-boot/components-starter/camel-atomix-starter/src/main/java/org/apache/camel/component/atomix/ha/springboot/AtomixClusterServiceAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-atomix-starter/src/main/java/org/apache/camel/component/atomix/ha/springboot/AtomixClusterServiceAutoConfiguration.java @@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.AllNestedConditions; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -48,6 +49,7 @@ public class AtomixClusterServiceAutoConfiguration { @Bean(initMethod = "start", destroyMethod = "stop") @Scope(ConfigurableBeanFactory.SCOPE_SINGLETON) @ConditionalOnProperty(prefix = "camel.component.atomix.cluster.service", name = "mode", havingValue = "node") + @ConditionalOnMissingBean public CamelClusterService atomixClusterService() { AtomixClusterService service = new AtomixClusterService(); service.setNodes(configuration.getNodes().stream().map(Address::new).collect(Collectors.toList())); @@ -65,6 +67,7 @@ public class AtomixClusterServiceAutoConfiguration { @Bean(initMethod = "start", destroyMethod = "stop") @Scope(ConfigurableBeanFactory.SCOPE_SINGLETON) @ConditionalOnProperty(prefix = "camel.component.atomix.cluster.service", name = "mode", havingValue = "client") + @ConditionalOnMissingBean public CamelClusterService atomixClusterClientService() { AtomixClusterClientService service = new AtomixClusterClientService(); service.setNodes(configuration.getNodes().stream().map(Address::new).collect(Collectors.toList()));