You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2024/04/17 09:26:46 UTC
(camel-spring-boot) branch main updated: [CAMEL-20675] move cluster service implementations to dedicated starters
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/main by this push:
new ff940999be9 [CAMEL-20675] move cluster service implementations to dedicated starters
ff940999be9 is described below
commit ff940999be92f873d2456ac338dcd2a7881c9298
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Sat Apr 13 16:36:59 2024 +0200
[CAMEL-20675] move cluster service implementations to dedicated starters
---
.../camel-consul-cluster-service-starter/pom.xml | 48 +++++
.../src/main/docs/consul-cluster-service.json | 179 ++++++++++++++++++
.../ConsulClusterServiceAutoConfiguration.java | 2 +-
.../cluster/ConsulClusterServiceConfiguration.java | 4 +-
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++++++++++++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 ++
...rk.boot.autoconfigure.AutoConfiguration.imports | 3 +-
.../ConsulClusterServiceAutoConfigurationTest.java | 67 +++++++
.../src/test/resources/logback.xml | 42 +++++
.../camel-consul-starter/src/main/docs/consul.json | 172 -----------------
...rk.boot.autoconfigure.AutoConfiguration.imports | 3 +-
.../camel-file-cluster-service-starter/pom.xml | 49 +++++
.../src/main/docs/file-cluster-service.json | 55 ++++++
.../FileLockClusterServiceAutoConfiguration.java | 2 +-
.../FileLockClusterServiceConfiguration.java | 4 +-
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++++++++++++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 ++
...rk.boot.autoconfigure.AutoConfiguration.imports | 1 -
.../FileClusterServiceAutoConfigurationTest.java | 68 +++++++
.../src/test/resources/logback.xml | 42 +++++
.../camel-file-starter/src/main/docs/file.json | 48 -----
...rk.boot.autoconfigure.AutoConfiguration.imports | 3 +-
.../pom.xml | 49 +++++
.../src/main/docs/infinispan-cluster-service.json | 97 ++++++++++
...ispanRemoteClusterServiceAutoConfiguration.java | 2 +-
...nfinispanRemoteClusterServiceConfiguration.java | 4 +-
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++++++++++++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 ++
...rk.boot.autoconfigure.AutoConfiguration.imports | 3 +-
...mbeddedClusterServiceAutoConfigurationTest.java | 68 +++++++
.../src/test/resources/logback.xml | 42 +++++
.../src/main/docs/infinispan.json | 90 ---------
...rk.boot.autoconfigure.AutoConfiguration.imports | 1 -
.../camel-jgroups-cluster-service-starter/pom.xml | 49 +++++
.../src/main/docs/jgroups-cluster-service.json | 37 ++++
...JGroupsLockClusterServiceAutoConfiguration.java | 4 +-
.../JGroupsLockClusterServiceConfiguration.java | 6 +-
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++++++++++++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 ++
...rk.boot.autoconfigure.AutoConfiguration.imports | 3 +-
...upsLockClusterServiceAutoConfigurationTest.java | 67 +++++++
.../src/test/resources/logback.xml | 42 +++++
.../pom.xml | 49 +++++
.../main/docs/jgroups-raft-cluster-service.json | 43 +++++
...JGroupsRaftClusterServiceAutoConfiguration.java | 4 +-
.../JGroupsRaftClusterServiceConfiguration.java | 6 +-
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++++++++++++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 ++
...rk.boot.autoconfigure.AutoConfiguration.imports | 3 +-
...upsRaftClusterServiceAutoConfigurationTest.java | 69 +++++++
.../src/test/resources/logback.xml | 42 +++++
.../src/main/docs/jgroups-raft.json | 36 ----
...rk.boot.autoconfigure.AutoConfiguration.imports | 3 +-
.../src/main/docs/jgroups.json | 30 ---
...rk.boot.autoconfigure.AutoConfiguration.imports | 3 +-
.../pom.xml | 49 +++++
.../src/main/docs/kubernetes-cluster-service.json | 97 ++++++++++
.../KubernetesClusterServiceAutoConfiguration.java | 6 +-
.../KubernetesClusterServiceConfiguration.java | 4 +-
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++++++++++++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 ++
...rk.boot.autoconfigure.AutoConfiguration.imports | 3 +-
...ernetesClusterServiceAutoConfigurationTest.java | 39 ++--
.../src/test/resources/logback.xml | 42 +++++
.../src/main/docs/kubernetes.json | 90 ---------
...rk.boot.autoconfigure.AutoConfiguration.imports | 1 -
.../pom.xml | 61 +++++++
.../src/main/docs/zookeeper-cluster-service.json | 144 +++++++++++++++
.../ZooKeeperClusterServiceAutoConfiguration.java | 2 +-
.../ZooKeeperClusterServiceConfiguration.java | 4 +-
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++++++++++++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 ++
...rk.boot.autoconfigure.AutoConfiguration.imports | 3 +-
.../cluster/ZooKeeperClusterServiceTest.java | 41 +++--
.../src/test/resources/logback.xml | 42 +++++
.../src/main/docs/zookeeper.json | 137 --------------
...rk.boot.autoconfigure.AutoConfiguration.imports | 3 +-
components-starter/pom.xml | 9 +-
tooling/camel-spring-boot-bom/pom.xml | 35 ++++
tooling/camel-spring-boot-dependencies/pom.xml | 35 ++++
.../springboot/maven/SpringBootStarterMojo.java | 4 +
81 files changed, 3307 insertions(+), 686 deletions(-)
diff --git a/components-starter/camel-consul-cluster-service-starter/pom.xml b/components-starter/camel-consul-cluster-service-starter/pom.xml
new file mode 100644
index 00000000000..2a3513efa5e
--- /dev/null
+++ b/components-starter/camel-consul-cluster-service-starter/pom.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>components-starter</artifactId>
+ <version>4.6.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>camel-consul-cluster-service-starter</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel SB Starters :: Consul Cluster Service</name>
+ <description>Spring-Boot Starter for Camel Cluster Service based on Consul</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-consul-starter</artifactId>
+ <version>${camel-version}</version>
+ </dependency>
+ <!--START OF GENERATED CODE-->
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-core-starter</artifactId>
+ </dependency>
+ <!--END OF GENERATED CODE-->
+ </dependencies>
+</project>
diff --git a/components-starter/camel-consul-cluster-service-starter/src/main/docs/consul-cluster-service.json b/components-starter/camel-consul-cluster-service-starter/src/main/docs/consul-cluster-service.json
new file mode 100644
index 00000000000..d4d8aff6687
--- /dev/null
+++ b/components-starter/camel-consul-cluster-service-starter/src/main/docs/consul-cluster-service.json
@@ -0,0 +1,179 @@
+{
+ "groups": [
+ {
+ "name": "camel.cluster.consul",
+ "type": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ }
+ ],
+ "properties": [
+ {
+ "name": "camel.cluster.consul.acl-token",
+ "type": "java.lang.String",
+ "description": "Sets the ACL token to be used with Consul",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.attributes",
+ "type": "java.util.Map<java.lang.String,java.lang.Object>",
+ "description": "Custom service attributes.",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.block-seconds",
+ "type": "java.lang.Integer",
+ "description": "The time (in seconds) to wait for a watch event, default 10 seconds",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
+ "defaultValue": 10
+ },
+ {
+ "name": "camel.cluster.consul.connect-timeout",
+ "type": "java.time.Duration",
+ "description": "Connect timeout for OkHttpClient",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.consistency-mode",
+ "type": "org.kiwiproject.consul.option.ConsistencyMode",
+ "description": "The consistencyMode used for queries, default ConsistencyMode.DEFAULT",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.datacenter",
+ "type": "java.lang.String",
+ "description": "The data center",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.enabled",
+ "type": "java.lang.Boolean",
+ "description": "Sets if the consul cluster service should be enabled or not, default is true.",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
+ "defaultValue": true
+ },
+ {
+ "name": "camel.cluster.consul.first-index",
+ "type": "java.math.BigInteger",
+ "description": "The first index for watch for, default 0",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
+ "defaultValue": 0
+ },
+ {
+ "name": "camel.cluster.consul.id",
+ "type": "java.lang.String",
+ "description": "Cluster Service ID",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.near-node",
+ "type": "java.lang.String",
+ "description": "The near node to use for queries.",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.node-meta",
+ "type": "java.util.List<java.lang.String>",
+ "description": "The note meta-data to use for queries.",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.order",
+ "type": "java.lang.Integer",
+ "description": "Service lookup order\/priority.",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.password",
+ "type": "java.lang.String",
+ "description": "Sets the password to be used for basic authentication",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.ping-instance",
+ "type": "java.lang.Boolean",
+ "description": "Configure if the AgentClient should attempt a ping before returning the Consul instance",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
+ "defaultValue": true
+ },
+ {
+ "name": "camel.cluster.consul.read-timeout",
+ "type": "java.time.Duration",
+ "description": "Read timeout for OkHttpClient",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.recursive",
+ "type": "java.lang.Boolean",
+ "description": "Recursively watch, default false",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
+ "defaultValue": false
+ },
+ {
+ "name": "camel.cluster.consul.root-path",
+ "type": "java.lang.String",
+ "description": "Consul root path",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
+ "defaultValue": "\/camel"
+ },
+ {
+ "name": "camel.cluster.consul.session-lock-delay",
+ "type": "java.lang.Integer",
+ "description": "The value for lockDelay",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
+ "defaultValue": 5
+ },
+ {
+ "name": "camel.cluster.consul.session-refresh-interval",
+ "type": "java.lang.Integer",
+ "description": "The value of wait attribute",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
+ "defaultValue": 5
+ },
+ {
+ "name": "camel.cluster.consul.session-ttl",
+ "type": "java.lang.Integer",
+ "description": "The value of TTL",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
+ "defaultValue": 60
+ },
+ {
+ "name": "camel.cluster.consul.ssl-context-parameters",
+ "type": "org.apache.camel.support.jsse.SSLContextParameters",
+ "description": "SSL configuration using an org.apache.camel.support.jsse.SSLContextParameters instance.",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.tags",
+ "type": "java.util.Set<java.lang.String>",
+ "description": "Set tags. You can separate multiple tags by comma.",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.url",
+ "type": "java.lang.String",
+ "description": "The Consul agent URL",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.user-name",
+ "type": "java.lang.String",
+ "description": "Sets the username to be used for basic authentication",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.write-timeout",
+ "type": "java.time.Duration",
+ "description": "Write timeout for OkHttpClient",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.consul.dc",
+ "type": "java.lang.String",
+ "description": "Use datacenter instead",
+ "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
+ "deprecated": true,
+ "deprecation": {}
+ }
+ ],
+ "hints": []
+}
\ No newline at end of file
diff --git a/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/cluster/ConsulClusterServiceAutoConfiguration.java b/components-starter/camel-consul-cluster-service-starter/src/main/java/org/apache/camel/component/consul/springboot/cluster/ConsulClusterServiceAutoConfiguration.java
similarity index 99%
rename from components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/cluster/ConsulClusterServiceAutoConfiguration.java
rename to components-starter/camel-consul-cluster-service-starter/src/main/java/org/apache/camel/component/consul/springboot/cluster/ConsulClusterServiceAutoConfiguration.java
index f1328817d8f..9125d8d6037 100644
--- a/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/cluster/ConsulClusterServiceAutoConfiguration.java
+++ b/components-starter/camel-consul-cluster-service-starter/src/main/java/org/apache/camel/component/consul/springboot/cluster/ConsulClusterServiceAutoConfiguration.java
@@ -33,7 +33,7 @@ import java.util.Optional;
@Configuration(proxyBeanMethods = false)
@AutoConfigureBefore({ ClusteredRouteControllerAutoConfiguration.class, CamelAutoConfiguration.class })
-@ConditionalOnProperty(prefix = "camel.cluster.consul", name = "enabled")
+@ConditionalOnProperty(prefix = "camel.cluster.consul", name = "enabled", matchIfMissing = true)
@EnableConfigurationProperties(ConsulClusterServiceConfiguration.class)
public class ConsulClusterServiceAutoConfiguration {
diff --git a/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/cluster/ConsulClusterServiceConfiguration.java b/components-starter/camel-consul-cluster-service-starter/src/main/java/org/apache/camel/component/consul/springboot/cluster/ConsulClusterServiceConfiguration.java
similarity index 98%
rename from components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/cluster/ConsulClusterServiceConfiguration.java
rename to components-starter/camel-consul-cluster-service-starter/src/main/java/org/apache/camel/component/consul/springboot/cluster/ConsulClusterServiceConfiguration.java
index 22b8e34e1df..d9c558e1d40 100644
--- a/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/cluster/ConsulClusterServiceConfiguration.java
+++ b/components-starter/camel-consul-cluster-service-starter/src/main/java/org/apache/camel/component/consul/springboot/cluster/ConsulClusterServiceConfiguration.java
@@ -32,9 +32,9 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
public class ConsulClusterServiceConfiguration extends ConsulClusterConfiguration {
/**
- * Sets if the consul cluster service should be enabled or not, default is false.
+ * Sets if the consul cluster service should be enabled or not, default is true.
*/
- private boolean enabled;
+ private boolean enabled = true;
/**
* Cluster Service ID
diff --git a/components-starter/camel-consul-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt b/components-starter/camel-consul-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 00000000000..6b0b1270ff0
--- /dev/null
+++ b/components-starter/camel-consul-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/components-starter/camel-consul-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt b/components-starter/camel-consul-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 00000000000..2e215bf2e6b
--- /dev/null
+++ b/components-starter/camel-consul-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-consul-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
similarity index 85%
copy from components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
copy to components-starter/camel-consul-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 6f3c841b357..bb45e07f529 100644
--- a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/components-starter/camel-consul-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -15,5 +15,4 @@
## limitations under the License.
## ---------------------------------------------------------------------------
-org.apache.camel.component.file.springboot.FileComponentAutoConfiguration
-org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceAutoConfiguration
\ No newline at end of file
+org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceAutoConfiguration
\ No newline at end of file
diff --git a/components-starter/camel-consul-cluster-service-starter/src/test/java/org/apache/camel/component/consul/springboot/cluster/ConsulClusterServiceAutoConfigurationTest.java b/components-starter/camel-consul-cluster-service-starter/src/test/java/org/apache/camel/component/consul/springboot/cluster/ConsulClusterServiceAutoConfigurationTest.java
new file mode 100644
index 00000000000..6b9cf5d0b59
--- /dev/null
+++ b/components-starter/camel-consul-cluster-service-starter/src/test/java/org/apache/camel/component/consul/springboot/cluster/ConsulClusterServiceAutoConfigurationTest.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.consul.springboot.cluster;
+
+import org.apache.camel.component.consul.cluster.ConsulClusterService;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.autoconfigure.AutoConfigurations;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.runner.ApplicationContextRunner;
+import org.springframework.context.annotation.Configuration;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class ConsulClusterServiceAutoConfigurationTest {
+
+ @Test
+ public void testDisable() {
+ new ApplicationContextRunner()
+ .withConfiguration(AutoConfigurations.of(ConsulClusterServiceAutoConfiguration.class))
+ .withUserConfiguration(TestConfiguration.class)
+ .withPropertyValues(
+ "spring.main.banner-mode=off",
+ "camel.cluster.consul.enabled=false")
+ .run(
+ context -> {
+ assertThat(context).doesNotHaveBean(ConsulClusterService.class);
+ });
+ }
+
+ /**
+ * Testing that the service can be enabled and configured completely.
+ */
+ @Test
+ public void testPropertiesMapped() {
+ new ApplicationContextRunner()
+ .withConfiguration(AutoConfigurations.of(ConsulClusterServiceAutoConfiguration.class))
+ .withUserConfiguration(TestConfiguration.class)
+ .withPropertyValues(
+ "spring.main.banner-mode=off",
+ "camel.cluster.consul.id=myid1")
+ .run(
+ context -> {
+ final ConsulClusterService clusterService = context.getBean(ConsulClusterService.class);
+
+ assertThat(clusterService.getId()).isEqualTo("myid1");
+ });
+ }
+
+ @EnableAutoConfiguration
+ @Configuration
+ public static class TestConfiguration {
+ }
+}
diff --git a/components-starter/camel-consul-cluster-service-starter/src/test/resources/logback.xml b/components-starter/camel-consul-cluster-service-starter/src/test/resources/logback.xml
new file mode 100644
index 00000000000..7f709ede714
--- /dev/null
+++ b/components-starter/camel-consul-cluster-service-starter/src/test/resources/logback.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<configuration>
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <!-- encoders are assigned the type
+ ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%-15.15thread] %-5level %-30.30logger - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%-15.15thread] %-5level %-30.30logger - %msg%n</pattern>
+ </encoder>
+ <file>target/camel-consul-cluster-service-starter-test.log</file>
+ </appender>
+
+ <root level="INFO">
+ <!--<appender-ref ref="STDOUT"/>-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</configuration>
\ No newline at end of file
diff --git a/components-starter/camel-consul-starter/src/main/docs/consul.json b/components-starter/camel-consul-starter/src/main/docs/consul.json
index cede3f91035..b3c3d1d7064 100644
--- a/components-starter/camel-consul-starter/src/main/docs/consul.json
+++ b/components-starter/camel-consul-starter/src/main/docs/consul.json
@@ -5,11 +5,6 @@
"type": "org.apache.camel.component.consul.springboot.cloud.ConsulServiceRegistryConfiguration",
"sourceType": "org.apache.camel.component.consul.springboot.cloud.ConsulServiceRegistryConfiguration"
},
- {
- "name": "camel.cluster.consul",
- "type": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
{
"name": "camel.component.consul",
"type": "org.apache.camel.component.consul.springboot.ConsulComponentConfiguration",
@@ -195,165 +190,6 @@
"description": "Write timeout for OkHttpClient",
"sourceType": "org.apache.camel.component.consul.springboot.cloud.ConsulServiceRegistryConfiguration"
},
- {
- "name": "camel.cluster.consul.acl-token",
- "type": "java.lang.String",
- "description": "Sets the ACL token to be used with Consul",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.consul.attributes",
- "type": "java.util.Map<java.lang.String,java.lang.Object>",
- "description": "Custom service attributes.",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.consul.block-seconds",
- "type": "java.lang.Integer",
- "description": "The time (in seconds) to wait for a watch event, default 10 seconds",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
- "defaultValue": 10
- },
- {
- "name": "camel.cluster.consul.connect-timeout",
- "type": "java.time.Duration",
- "description": "Connect timeout for OkHttpClient",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.consul.consistency-mode",
- "type": "org.kiwiproject.consul.option.ConsistencyMode",
- "description": "The consistencyMode used for queries, default ConsistencyMode.DEFAULT",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.consul.datacenter",
- "type": "java.lang.String",
- "description": "The data center",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.consul.enabled",
- "type": "java.lang.Boolean",
- "description": "Sets if the consul cluster service should be enabled or not, default is false.",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
- "defaultValue": false
- },
- {
- "name": "camel.cluster.consul.first-index",
- "type": "java.math.BigInteger",
- "description": "The first index for watch for, default 0",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
- "defaultValue": 0
- },
- {
- "name": "camel.cluster.consul.id",
- "type": "java.lang.String",
- "description": "Cluster Service ID",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.consul.near-node",
- "type": "java.lang.String",
- "description": "The near node to use for queries.",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.consul.node-meta",
- "type": "java.util.List<java.lang.String>",
- "description": "The note meta-data to use for queries.",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.consul.order",
- "type": "java.lang.Integer",
- "description": "Service lookup order\/priority.",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.consul.password",
- "type": "java.lang.String",
- "description": "Sets the password to be used for basic authentication",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.consul.ping-instance",
- "type": "java.lang.Boolean",
- "description": "Configure if the AgentClient should attempt a ping before returning the Consul instance",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
- "defaultValue": true
- },
- {
- "name": "camel.cluster.consul.read-timeout",
- "type": "java.time.Duration",
- "description": "Read timeout for OkHttpClient",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.consul.recursive",
- "type": "java.lang.Boolean",
- "description": "Recursively watch, default false",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
- "defaultValue": false
- },
- {
- "name": "camel.cluster.consul.root-path",
- "type": "java.lang.String",
- "description": "Consul root path",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
- "defaultValue": "\/camel"
- },
- {
- "name": "camel.cluster.consul.session-lock-delay",
- "type": "java.lang.Integer",
- "description": "The value for lockDelay",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
- "defaultValue": 5
- },
- {
- "name": "camel.cluster.consul.session-refresh-interval",
- "type": "java.lang.Integer",
- "description": "The value of wait attribute",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
- "defaultValue": 5
- },
- {
- "name": "camel.cluster.consul.session-ttl",
- "type": "java.lang.Integer",
- "description": "The value of TTL",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
- "defaultValue": 60
- },
- {
- "name": "camel.cluster.consul.ssl-context-parameters",
- "type": "org.apache.camel.support.jsse.SSLContextParameters",
- "description": "SSL configuration using an org.apache.camel.support.jsse.SSLContextParameters instance.",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.consul.tags",
- "type": "java.util.Set<java.lang.String>",
- "description": "Set tags. You can separate multiple tags by comma.",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.consul.url",
- "type": "java.lang.String",
- "description": "The Consul agent URL",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.consul.user-name",
- "type": "java.lang.String",
- "description": "Sets the username to be used for basic authentication",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.consul.write-timeout",
- "type": "java.time.Duration",
- "description": "Write timeout for OkHttpClient",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration"
- },
{
"name": "camel.component.consul.acl-token",
"type": "java.lang.String",
@@ -536,14 +372,6 @@
"sourceType": "org.apache.camel.component.consul.springboot.cloud.ConsulServiceRegistryConfiguration",
"deprecated": true,
"deprecation": {}
- },
- {
- "name": "camel.cluster.consul.dc",
- "type": "java.lang.String",
- "description": "Use datacenter instead",
- "sourceType": "org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceConfiguration",
- "deprecated": true,
- "deprecation": {}
}
],
"hints": []
diff --git a/components-starter/camel-consul-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-consul-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 31017a4c2fb..e484ca4addb 100644
--- a/components-starter/camel-consul-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/components-starter/camel-consul-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -18,5 +18,4 @@
org.apache.camel.component.consul.springboot.ConsulComponentConverter
org.apache.camel.component.consul.springboot.ConsulComponentAutoConfiguration
org.apache.camel.component.consul.springboot.cloud.ConsulServiceDiscoveryAutoConfiguration
-org.apache.camel.component.consul.springboot.cloud.ConsulServiceRegistryAutoConfiguration
-org.apache.camel.component.consul.springboot.cluster.ConsulClusterServiceAutoConfiguration
\ No newline at end of file
+org.apache.camel.component.consul.springboot.cloud.ConsulServiceRegistryAutoConfiguration
\ No newline at end of file
diff --git a/components-starter/camel-file-cluster-service-starter/pom.xml b/components-starter/camel-file-cluster-service-starter/pom.xml
new file mode 100644
index 00000000000..89919564f2c
--- /dev/null
+++ b/components-starter/camel-file-cluster-service-starter/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>components-starter</artifactId>
+ <version>4.6.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>camel-file-cluster-service-starter</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel SB Starters :: File Cluster Service</name>
+ <description>Spring-Boot Starter for Camel Cluster Service based on File lock</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <version>${spring-boot-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-file-starter</artifactId>
+ <version>${camel-version}</version>
+ </dependency>
+ <!--START OF GENERATED CODE-->
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-core-starter</artifactId>
+ </dependency>
+ <!--END OF GENERATED CODE-->
+ </dependencies>
+</project>
diff --git a/components-starter/camel-file-cluster-service-starter/src/main/docs/file-cluster-service.json b/components-starter/camel-file-cluster-service-starter/src/main/docs/file-cluster-service.json
new file mode 100644
index 00000000000..5c4d748a221
--- /dev/null
+++ b/components-starter/camel-file-cluster-service-starter/src/main/docs/file-cluster-service.json
@@ -0,0 +1,55 @@
+{
+ "groups": [
+ {
+ "name": "camel.cluster.file",
+ "type": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration",
+ "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration"
+ }
+ ],
+ "properties": [
+ {
+ "name": "camel.cluster.file.acquire-lock-delay",
+ "type": "java.lang.String",
+ "description": "The time to wait before starting to try to acquire lock.",
+ "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.file.acquire-lock-interval",
+ "type": "java.lang.String",
+ "description": "The time to wait between attempts to try to acquire lock.",
+ "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.file.attributes",
+ "type": "java.util.Map<java.lang.String,java.lang.Object>",
+ "description": "Custom service attributes.",
+ "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.file.enabled",
+ "type": "java.lang.Boolean",
+ "description": "Sets if the file cluster service should be enabled or not, default is true.",
+ "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration",
+ "defaultValue": true
+ },
+ {
+ "name": "camel.cluster.file.id",
+ "type": "java.lang.String",
+ "description": "Cluster Service ID",
+ "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.file.order",
+ "type": "java.lang.Integer",
+ "description": "Service lookup order\/priority.",
+ "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.file.root",
+ "type": "java.lang.String",
+ "description": "The root path.",
+ "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration"
+ }
+ ],
+ "hints": []
+}
\ No newline at end of file
diff --git a/components-starter/camel-file-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceAutoConfiguration.java b/components-starter/camel-file-cluster-service-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceAutoConfiguration.java
similarity index 99%
rename from components-starter/camel-file-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceAutoConfiguration.java
rename to components-starter/camel-file-cluster-service-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceAutoConfiguration.java
index cb46d18fea5..e1cd126ba68 100644
--- a/components-starter/camel-file-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceAutoConfiguration.java
+++ b/components-starter/camel-file-cluster-service-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceAutoConfiguration.java
@@ -35,7 +35,7 @@ import org.springframework.context.annotation.Scope;
@Configuration
@AutoConfigureBefore({ ClusteredRouteControllerAutoConfiguration.class, CamelAutoConfiguration.class })
-@ConditionalOnProperty(prefix = "camel.cluster.file", name = "enabled")
+@ConditionalOnProperty(prefix = "camel.cluster.file", name = "enabled", matchIfMissing = true)
@EnableConfigurationProperties(FileLockClusterServiceConfiguration.class)
public class FileLockClusterServiceAutoConfiguration {
@Autowired
diff --git a/components-starter/camel-file-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceConfiguration.java b/components-starter/camel-file-cluster-service-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceConfiguration.java
similarity index 98%
rename from components-starter/camel-file-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceConfiguration.java
rename to components-starter/camel-file-cluster-service-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceConfiguration.java
index d761fee59cd..f1ee76691c6 100644
--- a/components-starter/camel-file-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceConfiguration.java
+++ b/components-starter/camel-file-cluster-service-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceConfiguration.java
@@ -23,9 +23,9 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "camel.cluster.file")
public class FileLockClusterServiceConfiguration {
/**
- * Sets if the file cluster service should be enabled or not, default is false.
+ * Sets if the file cluster service should be enabled or not, default is true.
*/
- private boolean enabled;
+ private boolean enabled = true;
/**
* Cluster Service ID
diff --git a/components-starter/camel-file-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt b/components-starter/camel-file-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 00000000000..6b0b1270ff0
--- /dev/null
+++ b/components-starter/camel-file-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/components-starter/camel-file-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt b/components-starter/camel-file-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 00000000000..2e215bf2e6b
--- /dev/null
+++ b/components-starter/camel-file-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-file-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
similarity index 91%
copy from components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
copy to components-starter/camel-file-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 6f3c841b357..37264e4ab79 100644
--- a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/components-starter/camel-file-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -15,5 +15,4 @@
## limitations under the License.
## ---------------------------------------------------------------------------
-org.apache.camel.component.file.springboot.FileComponentAutoConfiguration
org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceAutoConfiguration
\ No newline at end of file
diff --git a/components-starter/camel-file-cluster-service-starter/src/test/java/org/apache/camel/component/file/springboot/cluster/FileClusterServiceAutoConfigurationTest.java b/components-starter/camel-file-cluster-service-starter/src/test/java/org/apache/camel/component/file/springboot/cluster/FileClusterServiceAutoConfigurationTest.java
new file mode 100644
index 00000000000..95cb2965fb3
--- /dev/null
+++ b/components-starter/camel-file-cluster-service-starter/src/test/java/org/apache/camel/component/file/springboot/cluster/FileClusterServiceAutoConfigurationTest.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.file.springboot.cluster;
+
+import org.apache.camel.component.file.cluster.FileLockClusterService;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.autoconfigure.AutoConfigurations;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.runner.ApplicationContextRunner;
+import org.springframework.context.annotation.Configuration;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class FileClusterServiceAutoConfigurationTest {
+
+ @Test
+ public void testDisable() {
+ new ApplicationContextRunner()
+ .withConfiguration(AutoConfigurations.of(FileLockClusterServiceAutoConfiguration.class))
+ .withUserConfiguration(TestConfiguration.class)
+ .withPropertyValues(
+ "spring.main.banner-mode=off",
+ "camel.cluster.file.enabled=false")
+ .run(
+ context -> {
+ assertThat(context).doesNotHaveBean(FileLockClusterService.class);
+ });
+ }
+
+ /**
+ * Testing that the service can be enabled and configured completely.
+ */
+ @Test
+ public void testPropertiesMapped() {
+ new ApplicationContextRunner()
+ .withConfiguration(AutoConfigurations.of(FileLockClusterServiceAutoConfiguration.class))
+ .withUserConfiguration(TestConfiguration.class)
+ .withPropertyValues(
+ "spring.main.banner-mode=off",
+ "camel.cluster.file.id=myid1")
+ .run(
+ context -> {
+ final FileLockClusterService clusterService = context.getBean(FileLockClusterService.class);
+
+ assertEquals("myid1", clusterService.getId());
+ });
+ }
+
+ @EnableAutoConfiguration
+ @Configuration
+ public static class TestConfiguration {
+ }
+}
diff --git a/components-starter/camel-file-cluster-service-starter/src/test/resources/logback.xml b/components-starter/camel-file-cluster-service-starter/src/test/resources/logback.xml
new file mode 100644
index 00000000000..6048df82ff8
--- /dev/null
+++ b/components-starter/camel-file-cluster-service-starter/src/test/resources/logback.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<configuration>
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <!-- encoders are assigned the type
+ ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%-15.15thread] %-5level %-30.30logger - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%-15.15thread] %-5level %-30.30logger - %msg%n</pattern>
+ </encoder>
+ <file>target/camel-file-cluster-service-starter-test.log</file>
+ </appender>
+
+ <root level="INFO">
+ <!--<appender-ref ref="STDOUT"/>-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</configuration>
\ No newline at end of file
diff --git a/components-starter/camel-file-starter/src/main/docs/file.json b/components-starter/camel-file-starter/src/main/docs/file.json
index 57a5de6c264..c6e3ef7a58e 100644
--- a/components-starter/camel-file-starter/src/main/docs/file.json
+++ b/components-starter/camel-file-starter/src/main/docs/file.json
@@ -1,10 +1,5 @@
{
"groups": [
- {
- "name": "camel.cluster.file",
- "type": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration",
- "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration"
- },
{
"name": "camel.component.file",
"type": "org.apache.camel.component.file.springboot.FileComponentConfiguration",
@@ -18,49 +13,6 @@
}
],
"properties": [
- {
- "name": "camel.cluster.file.acquire-lock-delay",
- "type": "java.lang.String",
- "description": "The time to wait before starting to try to acquire lock.",
- "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.file.acquire-lock-interval",
- "type": "java.lang.String",
- "description": "The time to wait between attempts to try to acquire lock.",
- "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.file.attributes",
- "type": "java.util.Map<java.lang.String,java.lang.Object>",
- "description": "Custom service attributes.",
- "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.file.enabled",
- "type": "java.lang.Boolean",
- "description": "Sets if the file cluster service should be enabled or not, default is false.",
- "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration",
- "defaultValue": false
- },
- {
- "name": "camel.cluster.file.id",
- "type": "java.lang.String",
- "description": "Cluster Service ID",
- "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.file.order",
- "type": "java.lang.Integer",
- "description": "Service lookup order\/priority.",
- "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.file.root",
- "type": "java.lang.String",
- "description": "The root path.",
- "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration"
- },
{
"name": "camel.component.file.autowired-enabled",
"type": "java.lang.Boolean",
diff --git a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 6f3c841b357..b535137b074 100644
--- a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -15,5 +15,4 @@
## limitations under the License.
## ---------------------------------------------------------------------------
-org.apache.camel.component.file.springboot.FileComponentAutoConfiguration
-org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceAutoConfiguration
\ No newline at end of file
+org.apache.camel.component.file.springboot.FileComponentAutoConfiguration
\ No newline at end of file
diff --git a/components-starter/camel-infinispan-cluster-service-starter/pom.xml b/components-starter/camel-infinispan-cluster-service-starter/pom.xml
new file mode 100644
index 00000000000..148640b3adb
--- /dev/null
+++ b/components-starter/camel-infinispan-cluster-service-starter/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>components-starter</artifactId>
+ <version>4.6.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>camel-infinispan-cluster-service-starter</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel SB Starters :: Infinispan Cluster Service</name>
+ <description>Spring-Boot Starter for Camel Cluster Service based on Infinispan</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <version>${spring-boot-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-infinispan-starter</artifactId>
+ <version>${camel-version}</version>
+ </dependency>
+ <!--START OF GENERATED CODE-->
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-core-starter</artifactId>
+ </dependency>
+ <!--END OF GENERATED CODE-->
+ </dependencies>
+</project>
diff --git a/components-starter/camel-infinispan-cluster-service-starter/src/main/docs/infinispan-cluster-service.json b/components-starter/camel-infinispan-cluster-service-starter/src/main/docs/infinispan-cluster-service.json
new file mode 100644
index 00000000000..7cd06b2d38c
--- /dev/null
+++ b/components-starter/camel-infinispan-cluster-service-starter/src/main/docs/infinispan-cluster-service.json
@@ -0,0 +1,97 @@
+{
+ "groups": [
+ {
+ "name": "camel.cluster.infinispan.remote",
+ "type": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ }
+ ],
+ "properties": [
+ {
+ "name": "camel.cluster.infinispan.remote.attributes",
+ "type": "java.util.Map<java.lang.String,java.lang.Object>",
+ "description": "Custom service attributes.",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.infinispan.remote.cache-container",
+ "type": "org.infinispan.client.hotrod.RemoteCacheManager",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.infinispan.remote.cache-container-configuration",
+ "type": "org.infinispan.client.hotrod.configuration.Configuration",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.infinispan.remote.configuration-properties",
+ "type": "java.util.Map<java.lang.String,java.lang.String>",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.infinispan.remote.enabled",
+ "type": "java.lang.Boolean",
+ "description": "Sets if the zookeeper cluster service should be enabled or not, default is true.",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration",
+ "defaultValue": true
+ },
+ {
+ "name": "camel.cluster.infinispan.remote.hosts",
+ "type": "java.lang.String",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.infinispan.remote.id",
+ "type": "java.lang.String",
+ "description": "Cluster Service ID",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.infinispan.remote.lifespan",
+ "type": "java.lang.Long",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.infinispan.remote.lifespan-time-unit",
+ "type": "java.util.concurrent.TimeUnit",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.infinispan.remote.order",
+ "type": "java.lang.Integer",
+ "description": "Service lookup order\/priority.",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.infinispan.remote.password",
+ "type": "java.lang.String",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.infinispan.remote.sasl-mechanism",
+ "type": "java.lang.String",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.infinispan.remote.secure",
+ "type": "java.lang.Boolean",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.infinispan.remote.security-realm",
+ "type": "java.lang.String",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.infinispan.remote.security-server-name",
+ "type": "java.lang.String",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.infinispan.remote.username",
+ "type": "java.lang.String",
+ "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
+ }
+ ],
+ "hints": []
+}
\ No newline at end of file
diff --git a/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/cluster/InfinispanRemoteClusterServiceAutoConfiguration.java b/components-starter/camel-infinispan-cluster-service-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/cluster/InfinispanRemoteClusterServiceAutoConfiguration.java
similarity index 98%
rename from components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/cluster/InfinispanRemoteClusterServiceAutoConfiguration.java
rename to components-starter/camel-infinispan-cluster-service-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/cluster/InfinispanRemoteClusterServiceAutoConfiguration.java
index 2132dc5957c..f6d729848d6 100644
--- a/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/cluster/InfinispanRemoteClusterServiceAutoConfiguration.java
+++ b/components-starter/camel-infinispan-cluster-service-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/cluster/InfinispanRemoteClusterServiceAutoConfiguration.java
@@ -33,7 +33,7 @@ import java.util.Optional;
@Configuration
@AutoConfigureBefore({ ClusteredRouteControllerAutoConfiguration.class, CamelAutoConfiguration.class })
-@ConditionalOnProperty(prefix = "camel.cluster.infinispan.remote", name = "enabled")
+@ConditionalOnProperty(prefix = "camel.cluster.infinispan.remote", name = "enabled", matchIfMissing = true)
@EnableConfigurationProperties(InfinispanRemoteClusterServiceConfiguration.class)
public class InfinispanRemoteClusterServiceAutoConfiguration {
diff --git a/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/cluster/InfinispanRemoteClusterServiceConfiguration.java b/components-starter/camel-infinispan-cluster-service-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/cluster/InfinispanRemoteClusterServiceConfiguration.java
similarity index 98%
rename from components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/cluster/InfinispanRemoteClusterServiceConfiguration.java
rename to components-starter/camel-infinispan-cluster-service-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/cluster/InfinispanRemoteClusterServiceConfiguration.java
index d58fec338b2..0c6c2d0c5ca 100644
--- a/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/cluster/InfinispanRemoteClusterServiceConfiguration.java
+++ b/components-starter/camel-infinispan-cluster-service-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/cluster/InfinispanRemoteClusterServiceConfiguration.java
@@ -26,9 +26,9 @@ import java.util.Map;
@ConfigurationProperties(prefix = "camel.cluster.infinispan.remote")
public class InfinispanRemoteClusterServiceConfiguration extends InfinispanRemoteClusterConfiguration {
/**
- * Sets if the zookeeper cluster service should be enabled or not, default is false.
+ * Sets if the zookeeper cluster service should be enabled or not, default is true.
*/
- private boolean enabled = false;
+ private boolean enabled = true;
/**
* Cluster Service ID
diff --git a/components-starter/camel-infinispan-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt b/components-starter/camel-infinispan-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 00000000000..6b0b1270ff0
--- /dev/null
+++ b/components-starter/camel-infinispan-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/components-starter/camel-infinispan-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt b/components-starter/camel-infinispan-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 00000000000..2e215bf2e6b
--- /dev/null
+++ b/components-starter/camel-infinispan-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-infinispan-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
similarity index 85%
copy from components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
copy to components-starter/camel-infinispan-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 6f3c841b357..43ffce36fe4 100644
--- a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/components-starter/camel-infinispan-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -15,5 +15,4 @@
## limitations under the License.
## ---------------------------------------------------------------------------
-org.apache.camel.component.file.springboot.FileComponentAutoConfiguration
-org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceAutoConfiguration
\ No newline at end of file
+org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceAutoConfiguration
diff --git a/components-starter/camel-infinispan-cluster-service-starter/src/test/java/org/apache/camel/component/infinispan/remote/springboot/cluster/InfinispanEmbeddedClusterServiceAutoConfigurationTest.java b/components-starter/camel-infinispan-cluster-service-starter/src/test/java/org/apache/camel/component/infinispan/remote/springboot/cluster/InfinispanEmbeddedClusterServiceAutoConfigurationTest.java
new file mode 100644
index 00000000000..fd99889b03e
--- /dev/null
+++ b/components-starter/camel-infinispan-cluster-service-starter/src/test/java/org/apache/camel/component/infinispan/remote/springboot/cluster/InfinispanEmbeddedClusterServiceAutoConfigurationTest.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.infinispan.remote.springboot.cluster;
+
+import org.apache.camel.component.infinispan.remote.cluster.InfinispanRemoteClusterService;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.autoconfigure.AutoConfigurations;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.runner.ApplicationContextRunner;
+import org.springframework.context.annotation.Configuration;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class InfinispanEmbeddedClusterServiceAutoConfigurationTest {
+
+ @Test
+ public void testDisable() {
+ new ApplicationContextRunner()
+ .withConfiguration(AutoConfigurations.of(InfinispanRemoteClusterServiceAutoConfiguration.class))
+ .withUserConfiguration(TestConfiguration.class)
+ .withPropertyValues(
+ "spring.main.banner-mode=off",
+ "camel.cluster.infinispan.remote.enabled=false")
+ .run(
+ context -> {
+ assertThat(context).doesNotHaveBean(InfinispanRemoteClusterService.class);
+ });
+ }
+
+ /**
+ * Testing that the service can be enabled and configured completely.
+ */
+ @Test
+ public void testPropertiesMapped() {
+ new ApplicationContextRunner()
+ .withConfiguration(AutoConfigurations.of(InfinispanRemoteClusterServiceAutoConfiguration.class))
+ .withUserConfiguration(TestConfiguration.class)
+ .withPropertyValues(
+ "spring.main.banner-mode=off",
+ "camel.cluster.infinispan.remote.id=myid1")
+ .run(
+ context -> {
+ final InfinispanRemoteClusterService clusterService = context.getBean(InfinispanRemoteClusterService.class);
+
+ assertEquals("myid1", clusterService.getId());
+ });
+ }
+
+ @EnableAutoConfiguration
+ @Configuration
+ public static class TestConfiguration {
+ }
+}
diff --git a/components-starter/camel-infinispan-cluster-service-starter/src/test/resources/logback.xml b/components-starter/camel-infinispan-cluster-service-starter/src/test/resources/logback.xml
new file mode 100644
index 00000000000..222b855d15b
--- /dev/null
+++ b/components-starter/camel-infinispan-cluster-service-starter/src/test/resources/logback.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<configuration>
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <!-- encoders are assigned the type
+ ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%-15.15thread] %-5level %-30.30logger - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%-15.15thread] %-5level %-30.30logger - %msg%n</pattern>
+ </encoder>
+ <file>target/camel-infinispan-cluster-service-starter-test.log</file>
+ </appender>
+
+ <root level="INFO">
+ <!--<appender-ref ref="STDOUT"/>-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</configuration>
\ No newline at end of file
diff --git a/components-starter/camel-infinispan-starter/src/main/docs/infinispan.json b/components-starter/camel-infinispan-starter/src/main/docs/infinispan.json
index aeddd2562bf..b8177fe915d 100644
--- a/components-starter/camel-infinispan-starter/src/main/docs/infinispan.json
+++ b/components-starter/camel-infinispan-starter/src/main/docs/infinispan.json
@@ -1,10 +1,5 @@
{
"groups": [
- {
- "name": "camel.cluster.infinispan.remote",
- "type": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
{
"name": "camel.component.infinispan",
"type": "org.apache.camel.component.infinispan.remote.springboot.InfinispanRemoteComponentConfiguration",
@@ -42,91 +37,6 @@
}
],
"properties": [
- {
- "name": "camel.cluster.infinispan.remote.attributes",
- "type": "java.util.Map<java.lang.String,java.lang.Object>",
- "description": "Custom service attributes.",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.infinispan.remote.cache-container",
- "type": "org.infinispan.client.hotrod.RemoteCacheManager",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.infinispan.remote.cache-container-configuration",
- "type": "org.infinispan.client.hotrod.configuration.Configuration",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.infinispan.remote.configuration-properties",
- "type": "java.util.Map<java.lang.String,java.lang.String>",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.infinispan.remote.enabled",
- "type": "java.lang.Boolean",
- "description": "Sets if the zookeeper cluster service should be enabled or not, default is false.",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration",
- "defaultValue": false
- },
- {
- "name": "camel.cluster.infinispan.remote.hosts",
- "type": "java.lang.String",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.infinispan.remote.id",
- "type": "java.lang.String",
- "description": "Cluster Service ID",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.infinispan.remote.lifespan",
- "type": "java.lang.Long",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.infinispan.remote.lifespan-time-unit",
- "type": "java.util.concurrent.TimeUnit",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.infinispan.remote.order",
- "type": "java.lang.Integer",
- "description": "Service lookup order\/priority.",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.infinispan.remote.password",
- "type": "java.lang.String",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.infinispan.remote.sasl-mechanism",
- "type": "java.lang.String",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.infinispan.remote.secure",
- "type": "java.lang.Boolean",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.infinispan.remote.security-realm",
- "type": "java.lang.String",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.infinispan.remote.security-server-name",
- "type": "java.lang.String",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.infinispan.remote.username",
- "type": "java.lang.String",
- "sourceType": "org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceConfiguration"
- },
{
"name": "camel.component.infinispan.autowired-enabled",
"type": "java.lang.Boolean",
diff --git a/components-starter/camel-infinispan-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-infinispan-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 470e9c3536c..9387ea57dd9 100644
--- a/components-starter/camel-infinispan-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/components-starter/camel-infinispan-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -17,4 +17,3 @@
org.apache.camel.component.infinispan.remote.springboot.InfinispanRemoteComponentConverter
org.apache.camel.component.infinispan.remote.springboot.InfinispanRemoteComponentAutoConfiguration
-org.apache.camel.component.infinispan.remote.springboot.cluster.InfinispanRemoteClusterServiceAutoConfiguration
diff --git a/components-starter/camel-jgroups-cluster-service-starter/pom.xml b/components-starter/camel-jgroups-cluster-service-starter/pom.xml
new file mode 100644
index 00000000000..67ea624b404
--- /dev/null
+++ b/components-starter/camel-jgroups-cluster-service-starter/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>components-starter</artifactId>
+ <version>4.6.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>camel-jgroups-cluster-service-starter</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel SB Starters :: JGroups Cluster Service</name>
+ <description>Spring-Boot Starter for Camel Cluster Service based on JGroups</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <version>${spring-boot-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-jgroups-starter</artifactId>
+ <version>${camel-version}</version>
+ </dependency>
+ <!--START OF GENERATED CODE-->
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-core-starter</artifactId>
+ </dependency>
+ <!--END OF GENERATED CODE-->
+ </dependencies>
+</project>
diff --git a/components-starter/camel-jgroups-cluster-service-starter/src/main/docs/jgroups-cluster-service.json b/components-starter/camel-jgroups-cluster-service-starter/src/main/docs/jgroups-cluster-service.json
new file mode 100644
index 00000000000..79001e466da
--- /dev/null
+++ b/components-starter/camel-jgroups-cluster-service-starter/src/main/docs/jgroups-cluster-service.json
@@ -0,0 +1,37 @@
+{
+ "groups": [
+ {
+ "name": "camel.cluster.jgroups",
+ "type": "org.apache.camel.component.jgroups.springboot.cluster.JGroupsLockClusterServiceConfiguration",
+ "sourceType": "org.apache.camel.component.jgroups.springboot.cluster.JGroupsLockClusterServiceConfiguration"
+ }
+ ],
+ "properties": [
+ {
+ "name": "camel.cluster.jgroups.enabled",
+ "type": "java.lang.Boolean",
+ "description": "Sets if the jgroups lock cluster service should be enabled or not, default is true.",
+ "sourceType": "org.apache.camel.component.jgroups.springboot.cluster.JGroupsLockClusterServiceConfiguration",
+ "defaultValue": true
+ },
+ {
+ "name": "camel.cluster.jgroups.id",
+ "type": "java.lang.String",
+ "description": "Cluster Service ID",
+ "sourceType": "org.apache.camel.component.jgroups.springboot.cluster.JGroupsLockClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.jgroups.jgroups-cluster-name",
+ "type": "java.lang.String",
+ "description": "JGroups Cluster name",
+ "sourceType": "org.apache.camel.component.jgroups.springboot.cluster.JGroupsLockClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.jgroups.jgroups-config",
+ "type": "java.lang.String",
+ "description": "JGrups configuration File name",
+ "sourceType": "org.apache.camel.component.jgroups.springboot.cluster.JGroupsLockClusterServiceConfiguration"
+ }
+ ],
+ "hints": []
+}
\ No newline at end of file
diff --git a/components-starter/camel-jgroups-starter/src/main/java/org/apache/camel/component/jgroups/springboot/cluster/springboot/JGroupsLockClusterServiceAutoConfiguration.java b/components-starter/camel-jgroups-cluster-service-starter/src/main/java/org/apache/camel/component/jgroups/springboot/cluster/JGroupsLockClusterServiceAutoConfiguration.java
similarity index 96%
rename from components-starter/camel-jgroups-starter/src/main/java/org/apache/camel/component/jgroups/springboot/cluster/springboot/JGroupsLockClusterServiceAutoConfiguration.java
rename to components-starter/camel-jgroups-cluster-service-starter/src/main/java/org/apache/camel/component/jgroups/springboot/cluster/JGroupsLockClusterServiceAutoConfiguration.java
index e0eab69c53a..7c59947d0ce 100644
--- a/components-starter/camel-jgroups-starter/src/main/java/org/apache/camel/component/jgroups/springboot/cluster/springboot/JGroupsLockClusterServiceAutoConfiguration.java
+++ b/components-starter/camel-jgroups-cluster-service-starter/src/main/java/org/apache/camel/component/jgroups/springboot/cluster/JGroupsLockClusterServiceAutoConfiguration.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.jgroups.springboot.cluster.springboot;
+package org.apache.camel.component.jgroups.springboot.cluster;
import org.apache.camel.cluster.CamelClusterService;
import org.apache.camel.component.jgroups.cluster.JGroupsLockClusterService;
@@ -33,7 +33,7 @@ import java.util.Optional;
@Configuration
@AutoConfigureBefore({ ClusteredRouteControllerAutoConfiguration.class, CamelAutoConfiguration.class })
-@ConditionalOnProperty(prefix = "camel.cluster.jgroups", name = "enabled")
+@ConditionalOnProperty(prefix = "camel.cluster.jgroups", name = "enabled", matchIfMissing = true)
@EnableConfigurationProperties(JGroupsLockClusterServiceConfiguration.class)
public class JGroupsLockClusterServiceAutoConfiguration {
diff --git a/components-starter/camel-jgroups-starter/src/main/java/org/apache/camel/component/jgroups/springboot/cluster/springboot/JGroupsLockClusterServiceConfiguration.java b/components-starter/camel-jgroups-cluster-service-starter/src/main/java/org/apache/camel/component/jgroups/springboot/cluster/JGroupsLockClusterServiceConfiguration.java
similarity index 93%
rename from components-starter/camel-jgroups-starter/src/main/java/org/apache/camel/component/jgroups/springboot/cluster/springboot/JGroupsLockClusterServiceConfiguration.java
rename to components-starter/camel-jgroups-cluster-service-starter/src/main/java/org/apache/camel/component/jgroups/springboot/cluster/JGroupsLockClusterServiceConfiguration.java
index 98d2d8387aa..f8fca7bbea2 100644
--- a/components-starter/camel-jgroups-starter/src/main/java/org/apache/camel/component/jgroups/springboot/cluster/springboot/JGroupsLockClusterServiceConfiguration.java
+++ b/components-starter/camel-jgroups-cluster-service-starter/src/main/java/org/apache/camel/component/jgroups/springboot/cluster/JGroupsLockClusterServiceConfiguration.java
@@ -14,16 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.jgroups.springboot.cluster.springboot;
+package org.apache.camel.component.jgroups.springboot.cluster;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "camel.cluster.jgroups")
public class JGroupsLockClusterServiceConfiguration {
/**
- * Sets if the jgroups lock cluster service should be enabled or not, default is false.
+ * Sets if the jgroups lock cluster service should be enabled or not, default is true.
*/
- private boolean enabled;
+ private boolean enabled = true;
/**
* Cluster Service ID
diff --git a/components-starter/camel-jgroups-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt b/components-starter/camel-jgroups-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 00000000000..6b0b1270ff0
--- /dev/null
+++ b/components-starter/camel-jgroups-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/components-starter/camel-jgroups-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt b/components-starter/camel-jgroups-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 00000000000..2e215bf2e6b
--- /dev/null
+++ b/components-starter/camel-jgroups-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-jgroups-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
similarity index 85%
copy from components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
copy to components-starter/camel-jgroups-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 6f3c841b357..9971c3320e5 100644
--- a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/components-starter/camel-jgroups-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -15,5 +15,4 @@
## limitations under the License.
## ---------------------------------------------------------------------------
-org.apache.camel.component.file.springboot.FileComponentAutoConfiguration
-org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceAutoConfiguration
\ No newline at end of file
+org.apache.camel.component.jgroups.springboot.cluster.JGroupsLockClusterServiceAutoConfiguration
\ No newline at end of file
diff --git a/components-starter/camel-jgroups-cluster-service-starter/src/test/java/org/apache/camel/component/jgroups/springboot/cluster/JGroupsLockClusterServiceAutoConfigurationTest.java b/components-starter/camel-jgroups-cluster-service-starter/src/test/java/org/apache/camel/component/jgroups/springboot/cluster/JGroupsLockClusterServiceAutoConfigurationTest.java
new file mode 100644
index 00000000000..02e9f648153
--- /dev/null
+++ b/components-starter/camel-jgroups-cluster-service-starter/src/test/java/org/apache/camel/component/jgroups/springboot/cluster/JGroupsLockClusterServiceAutoConfigurationTest.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jgroups.springboot.cluster;
+
+import org.apache.camel.component.jgroups.cluster.JGroupsLockClusterService;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.autoconfigure.AutoConfigurations;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.runner.ApplicationContextRunner;
+import org.springframework.context.annotation.Configuration;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class JGroupsLockClusterServiceAutoConfigurationTest {
+
+ @Test
+ public void testDisable() {
+ new ApplicationContextRunner()
+ .withConfiguration(AutoConfigurations.of(JGroupsLockClusterServiceAutoConfiguration.class))
+ .withUserConfiguration(TestConfiguration.class)
+ .withPropertyValues(
+ "spring.main.banner-mode=off",
+ "camel.cluster.jgroups.enabled=false")
+ .run(
+ context -> {
+ assertThat(context).doesNotHaveBean(JGroupsLockClusterService.class);
+ });
+ }
+
+ /**
+ * Testing that the service can be enabled and configured completely.
+ */
+ @Test
+ public void testPropertiesMapped() {
+ new ApplicationContextRunner()
+ .withConfiguration(AutoConfigurations.of(JGroupsLockClusterServiceAutoConfiguration.class))
+ .withUserConfiguration(TestConfiguration.class)
+ .withPropertyValues(
+ "spring.main.banner-mode=off",
+ "camel.cluster.jgroups.id=myid1")
+ .run(
+ context -> {
+ final JGroupsLockClusterService clusterService = context.getBean(JGroupsLockClusterService.class);
+
+ assertThat(clusterService.getId()).isEqualTo("myid1");
+ });
+ }
+
+ @EnableAutoConfiguration
+ @Configuration
+ public static class TestConfiguration {
+ }
+}
diff --git a/components-starter/camel-jgroups-cluster-service-starter/src/test/resources/logback.xml b/components-starter/camel-jgroups-cluster-service-starter/src/test/resources/logback.xml
new file mode 100644
index 00000000000..31fc824328b
--- /dev/null
+++ b/components-starter/camel-jgroups-cluster-service-starter/src/test/resources/logback.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<configuration>
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <!-- encoders are assigned the type
+ ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%-15.15thread] %-5level %-30.30logger - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%-15.15thread] %-5level %-30.30logger - %msg%n</pattern>
+ </encoder>
+ <file>target/camel-jgroups-cluster-service-starter-test.log</file>
+ </appender>
+
+ <root level="INFO">
+ <!--<appender-ref ref="STDOUT"/>-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</configuration>
\ No newline at end of file
diff --git a/components-starter/camel-jgroups-raft-cluster-service-starter/pom.xml b/components-starter/camel-jgroups-raft-cluster-service-starter/pom.xml
new file mode 100644
index 00000000000..59f9feea09f
--- /dev/null
+++ b/components-starter/camel-jgroups-raft-cluster-service-starter/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>components-starter</artifactId>
+ <version>4.6.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>camel-jgroups-raft-cluster-service-starter</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel SB Starters :: JGroups Raft Cluster Service</name>
+ <description>Spring-Boot Starter for Camel Cluster Service based on JGroups Raft</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <version>${spring-boot-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-jgroups-raft-starter</artifactId>
+ <version>${camel-version}</version>
+ </dependency>
+ <!--START OF GENERATED CODE-->
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-core-starter</artifactId>
+ </dependency>
+ <!--END OF GENERATED CODE-->
+ </dependencies>
+</project>
diff --git a/components-starter/camel-jgroups-raft-cluster-service-starter/src/main/docs/jgroups-raft-cluster-service.json b/components-starter/camel-jgroups-raft-cluster-service-starter/src/main/docs/jgroups-raft-cluster-service.json
new file mode 100644
index 00000000000..16af7d3fc86
--- /dev/null
+++ b/components-starter/camel-jgroups-raft-cluster-service-starter/src/main/docs/jgroups-raft-cluster-service.json
@@ -0,0 +1,43 @@
+{
+ "groups": [
+ {
+ "name": "camel.cluster.jgroups-raft",
+ "type": "org.apache.camel.component.jgroups.raft.springboot.cluster.JGroupsRaftClusterServiceConfiguration",
+ "sourceType": "org.apache.camel.component.jgroups.raft.springboot.cluster.JGroupsRaftClusterServiceConfiguration"
+ }
+ ],
+ "properties": [
+ {
+ "name": "camel.cluster.jgroups-raft.enabled",
+ "type": "java.lang.Boolean",
+ "description": "Sets if the jgroups raft cluster service should be enabled or not, default is true.",
+ "sourceType": "org.apache.camel.component.jgroups.raft.springboot.cluster.JGroupsRaftClusterServiceConfiguration",
+ "defaultValue": true
+ },
+ {
+ "name": "camel.cluster.jgroups-raft.id",
+ "type": "java.lang.String",
+ "description": "Cluster Service ID",
+ "sourceType": "org.apache.camel.component.jgroups.raft.springboot.cluster.JGroupsRaftClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.jgroups-raft.jgroups-raft-cluster-name",
+ "type": "java.lang.String",
+ "description": "JGroups Cluster name",
+ "sourceType": "org.apache.camel.component.jgroups.raft.springboot.cluster.JGroupsRaftClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.jgroups-raft.jgroups-raft-config",
+ "type": "java.lang.String",
+ "description": "JGrups-raft configuration File name",
+ "sourceType": "org.apache.camel.component.jgroups.raft.springboot.cluster.JGroupsRaftClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.jgroups-raft.raft-id",
+ "type": "java.lang.String",
+ "description": "JGroups-raft ID",
+ "sourceType": "org.apache.camel.component.jgroups.raft.springboot.cluster.JGroupsRaftClusterServiceConfiguration"
+ }
+ ],
+ "hints": []
+}
\ No newline at end of file
diff --git a/components-starter/camel-jgroups-raft-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/cluster/springboot/JGroupsRaftClusterServiceAutoConfiguration.java b/components-starter/camel-jgroups-raft-cluster-service-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/cluster/JGroupsRaftClusterServiceAutoConfiguration.java
similarity index 98%
rename from components-starter/camel-jgroups-raft-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/cluster/springboot/JGroupsRaftClusterServiceAutoConfiguration.java
rename to components-starter/camel-jgroups-raft-cluster-service-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/cluster/JGroupsRaftClusterServiceAutoConfiguration.java
index 261a0226ba4..2abefa1332e 100644
--- a/components-starter/camel-jgroups-raft-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/cluster/springboot/JGroupsRaftClusterServiceAutoConfiguration.java
+++ b/components-starter/camel-jgroups-raft-cluster-service-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/cluster/JGroupsRaftClusterServiceAutoConfiguration.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.jgroups.raft.springboot.cluster.springboot;
+package org.apache.camel.component.jgroups.raft.springboot.cluster;
import org.apache.camel.cluster.CamelClusterService;
import org.apache.camel.component.jgroups.raft.cluster.JGroupsRaftClusterService;
@@ -33,7 +33,7 @@ import java.util.Optional;
@Configuration(proxyBeanMethods = false)
@AutoConfigureBefore({ ClusteredRouteControllerAutoConfiguration.class, CamelAutoConfiguration.class })
-@ConditionalOnProperty(prefix = "camel.cluster.jgroups-raft", name = "enabled")
+@ConditionalOnProperty(prefix = "camel.cluster.jgroups-raft", name = "enabled", matchIfMissing = true)
@EnableConfigurationProperties(JGroupsRaftClusterServiceConfiguration.class)
public class JGroupsRaftClusterServiceAutoConfiguration {
diff --git a/components-starter/camel-jgroups-raft-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/cluster/springboot/JGroupsRaftClusterServiceConfiguration.java b/components-starter/camel-jgroups-raft-cluster-service-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/cluster/JGroupsRaftClusterServiceConfiguration.java
similarity index 96%
rename from components-starter/camel-jgroups-raft-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/cluster/springboot/JGroupsRaftClusterServiceConfiguration.java
rename to components-starter/camel-jgroups-raft-cluster-service-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/cluster/JGroupsRaftClusterServiceConfiguration.java
index 232c6ef39ee..ec2c548e8ba 100644
--- a/components-starter/camel-jgroups-raft-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/cluster/springboot/JGroupsRaftClusterServiceConfiguration.java
+++ b/components-starter/camel-jgroups-raft-cluster-service-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/cluster/JGroupsRaftClusterServiceConfiguration.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.jgroups.raft.springboot.cluster.springboot;
+package org.apache.camel.component.jgroups.raft.springboot.cluster;
import org.springframework.boot.context.properties.ConfigurationProperties;
@@ -22,9 +22,9 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
public class JGroupsRaftClusterServiceConfiguration {
/**
- * Sets if the jgroups raft cluster service should be enabled or not, default is false.
+ * Sets if the jgroups raft cluster service should be enabled or not, default is true.
*/
- private boolean enabled;
+ private boolean enabled = true;
/**
* Cluster Service ID
diff --git a/components-starter/camel-jgroups-raft-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt b/components-starter/camel-jgroups-raft-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 00000000000..6b0b1270ff0
--- /dev/null
+++ b/components-starter/camel-jgroups-raft-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/components-starter/camel-jgroups-raft-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt b/components-starter/camel-jgroups-raft-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 00000000000..2e215bf2e6b
--- /dev/null
+++ b/components-starter/camel-jgroups-raft-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-jgroups-raft-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
similarity index 85%
copy from components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
copy to components-starter/camel-jgroups-raft-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 6f3c841b357..e9a542bcd3c 100644
--- a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/components-starter/camel-jgroups-raft-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -15,5 +15,4 @@
## limitations under the License.
## ---------------------------------------------------------------------------
-org.apache.camel.component.file.springboot.FileComponentAutoConfiguration
-org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceAutoConfiguration
\ No newline at end of file
+org.apache.camel.component.jgroups.raft.springboot.cluster.JGroupsRaftClusterServiceAutoConfiguration
\ No newline at end of file
diff --git a/components-starter/camel-jgroups-raft-cluster-service-starter/src/test/java/org/apache/camel/component/jgroups/raft/springboot/cluster/JGroupsRaftClusterServiceAutoConfigurationTest.java b/components-starter/camel-jgroups-raft-cluster-service-starter/src/test/java/org/apache/camel/component/jgroups/raft/springboot/cluster/JGroupsRaftClusterServiceAutoConfigurationTest.java
new file mode 100644
index 00000000000..b2cc86f9b51
--- /dev/null
+++ b/components-starter/camel-jgroups-raft-cluster-service-starter/src/test/java/org/apache/camel/component/jgroups/raft/springboot/cluster/JGroupsRaftClusterServiceAutoConfigurationTest.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jgroups.raft.springboot.cluster;
+
+import org.apache.camel.component.jgroups.raft.cluster.JGroupsRaftClusterService;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.autoconfigure.AutoConfigurations;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.runner.ApplicationContextRunner;
+import org.springframework.context.annotation.Configuration;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+public class JGroupsRaftClusterServiceAutoConfigurationTest {
+
+ @Test
+ public void testDisable() {
+ new ApplicationContextRunner()
+ .withConfiguration(AutoConfigurations.of(JGroupsRaftClusterServiceAutoConfiguration.class))
+ .withUserConfiguration(TestConfiguration.class)
+ .withPropertyValues(
+ "spring.main.banner-mode=off",
+ "camel.cluster.jgroups-raft.enabled=false")
+ .run(
+ context -> {
+ assertThat(context).doesNotHaveBean(JGroupsRaftClusterService.class);
+ });
+ }
+
+ /**
+ * Testing that the service can be enabled and configured completely.
+ */
+ @Test
+ public void testPropertiesMapped() {
+ new ApplicationContextRunner()
+ .withConfiguration(AutoConfigurations.of(JGroupsRaftClusterServiceAutoConfiguration.class))
+ .withUserConfiguration(TestConfiguration.class)
+ .withPropertyValues(
+ "spring.main.banner-mode=off",
+ "camel.cluster.jgroups-raft.id=myid1")
+ .run(
+ context -> {
+ final JGroupsRaftClusterService clusterService = context.getBean(JGroupsRaftClusterService.class);
+
+ assertEquals("myid1", clusterService.getId());
+ });
+ }
+
+ @EnableAutoConfiguration
+ @Configuration
+ public static class TestConfiguration {
+ }
+}
diff --git a/components-starter/camel-jgroups-raft-cluster-service-starter/src/test/resources/logback.xml b/components-starter/camel-jgroups-raft-cluster-service-starter/src/test/resources/logback.xml
new file mode 100644
index 00000000000..16a9e00dce0
--- /dev/null
+++ b/components-starter/camel-jgroups-raft-cluster-service-starter/src/test/resources/logback.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<configuration>
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <!-- encoders are assigned the type
+ ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%-15.15thread] %-5level %-30.30logger - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%-15.15thread] %-5level %-30.30logger - %msg%n</pattern>
+ </encoder>
+ <file>target/camel-jgroups-raft-cluster-service-starter-test.log</file>
+ </appender>
+
+ <root level="INFO">
+ <!--<appender-ref ref="STDOUT"/>-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</configuration>
\ No newline at end of file
diff --git a/components-starter/camel-jgroups-raft-starter/src/main/docs/jgroups-raft.json b/components-starter/camel-jgroups-raft-starter/src/main/docs/jgroups-raft.json
index 3e6892caae9..7677e1bb4e9 100644
--- a/components-starter/camel-jgroups-raft-starter/src/main/docs/jgroups-raft.json
+++ b/components-starter/camel-jgroups-raft-starter/src/main/docs/jgroups-raft.json
@@ -1,10 +1,5 @@
{
"groups": [
- {
- "name": "camel.cluster.jgroups-raft",
- "type": "org.apache.camel.component.jgroups.raft.springboot.cluster.springboot.JGroupsRaftClusterServiceConfiguration",
- "sourceType": "org.apache.camel.component.jgroups.raft.springboot.cluster.springboot.JGroupsRaftClusterServiceConfiguration"
- },
{
"name": "camel.component.jgroups-raft",
"type": "org.apache.camel.component.jgroups.raft.springboot.JGroupsRaftComponentConfiguration",
@@ -18,37 +13,6 @@
}
],
"properties": [
- {
- "name": "camel.cluster.jgroups-raft.enabled",
- "type": "java.lang.Boolean",
- "description": "Sets if the jgroups raft cluster service should be enabled or not, default is false.",
- "sourceType": "org.apache.camel.component.jgroups.raft.springboot.cluster.springboot.JGroupsRaftClusterServiceConfiguration",
- "defaultValue": false
- },
- {
- "name": "camel.cluster.jgroups-raft.id",
- "type": "java.lang.String",
- "description": "Cluster Service ID",
- "sourceType": "org.apache.camel.component.jgroups.raft.springboot.cluster.springboot.JGroupsRaftClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.jgroups-raft.jgroups-raft-cluster-name",
- "type": "java.lang.String",
- "description": "JGroups Cluster name",
- "sourceType": "org.apache.camel.component.jgroups.raft.springboot.cluster.springboot.JGroupsRaftClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.jgroups-raft.jgroups-raft-config",
- "type": "java.lang.String",
- "description": "JGrups-raft configuration File name",
- "sourceType": "org.apache.camel.component.jgroups.raft.springboot.cluster.springboot.JGroupsRaftClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.jgroups-raft.raft-id",
- "type": "java.lang.String",
- "description": "JGroups-raft ID",
- "sourceType": "org.apache.camel.component.jgroups.raft.springboot.cluster.springboot.JGroupsRaftClusterServiceConfiguration"
- },
{
"name": "camel.component.jgroups-raft.autowired-enabled",
"type": "java.lang.Boolean",
diff --git a/components-starter/camel-jgroups-raft-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-jgroups-raft-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index f4645fc1ed9..178c257bbdb 100644
--- a/components-starter/camel-jgroups-raft-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/components-starter/camel-jgroups-raft-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -16,5 +16,4 @@
## ---------------------------------------------------------------------------
org.apache.camel.component.jgroups.raft.springboot.JGroupsRaftComponentConverter
-org.apache.camel.component.jgroups.raft.springboot.JGroupsRaftComponentAutoConfiguration
-org.apache.camel.component.jgroups.raft.springboot.cluster.springboot.JGroupsRaftClusterServiceAutoConfiguration
\ No newline at end of file
+org.apache.camel.component.jgroups.raft.springboot.JGroupsRaftComponentAutoConfiguration
\ No newline at end of file
diff --git a/components-starter/camel-jgroups-starter/src/main/docs/jgroups.json b/components-starter/camel-jgroups-starter/src/main/docs/jgroups.json
index f319087f97b..a7119647d93 100644
--- a/components-starter/camel-jgroups-starter/src/main/docs/jgroups.json
+++ b/components-starter/camel-jgroups-starter/src/main/docs/jgroups.json
@@ -1,10 +1,5 @@
{
"groups": [
- {
- "name": "camel.cluster.jgroups",
- "type": "org.apache.camel.component.jgroups.springboot.cluster.springboot.JGroupsLockClusterServiceConfiguration",
- "sourceType": "org.apache.camel.component.jgroups.springboot.cluster.springboot.JGroupsLockClusterServiceConfiguration"
- },
{
"name": "camel.component.jgroups",
"type": "org.apache.camel.component.jgroups.springboot.JGroupsComponentConfiguration",
@@ -18,31 +13,6 @@
}
],
"properties": [
- {
- "name": "camel.cluster.jgroups.enabled",
- "type": "java.lang.Boolean",
- "description": "Sets if the jgroups lock cluster service should be enabled or not, default is false.",
- "sourceType": "org.apache.camel.component.jgroups.springboot.cluster.springboot.JGroupsLockClusterServiceConfiguration",
- "defaultValue": false
- },
- {
- "name": "camel.cluster.jgroups.id",
- "type": "java.lang.String",
- "description": "Cluster Service ID",
- "sourceType": "org.apache.camel.component.jgroups.springboot.cluster.springboot.JGroupsLockClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.jgroups.jgroups-cluster-name",
- "type": "java.lang.String",
- "description": "JGroups Cluster name",
- "sourceType": "org.apache.camel.component.jgroups.springboot.cluster.springboot.JGroupsLockClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.jgroups.jgroups-config",
- "type": "java.lang.String",
- "description": "JGrups configuration File name",
- "sourceType": "org.apache.camel.component.jgroups.springboot.cluster.springboot.JGroupsLockClusterServiceConfiguration"
- },
{
"name": "camel.component.jgroups.autowired-enabled",
"type": "java.lang.Boolean",
diff --git a/components-starter/camel-jgroups-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-jgroups-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 71b321eb893..063a862b7fc 100644
--- a/components-starter/camel-jgroups-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/components-starter/camel-jgroups-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -16,5 +16,4 @@
## ---------------------------------------------------------------------------
org.apache.camel.component.jgroups.springboot.JGroupsComponentConverter
-org.apache.camel.component.jgroups.springboot.JGroupsComponentAutoConfiguration
-org.apache.camel.component.jgroups.springboot.cluster.springboot.JGroupsLockClusterServiceAutoConfiguration
\ No newline at end of file
+org.apache.camel.component.jgroups.springboot.JGroupsComponentAutoConfiguration
\ No newline at end of file
diff --git a/components-starter/camel-kubernetes-cluster-service-starter/pom.xml b/components-starter/camel-kubernetes-cluster-service-starter/pom.xml
new file mode 100644
index 00000000000..64d68f62e7e
--- /dev/null
+++ b/components-starter/camel-kubernetes-cluster-service-starter/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>components-starter</artifactId>
+ <version>4.6.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>camel-kubernetes-cluster-service-starter</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel SB Starters :: Kubernetes Cluster Service</name>
+ <description>Spring-Boot Starter for Camel Cluster Service based on Kubernetes</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <version>${spring-boot-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-kubernetes-starter</artifactId>
+ <version>${camel-version}</version>
+ </dependency>
+ <!--START OF GENERATED CODE-->
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-core-starter</artifactId>
+ </dependency>
+ <!--END OF GENERATED CODE-->
+ </dependencies>
+</project>
diff --git a/components-starter/camel-kubernetes-cluster-service-starter/src/main/docs/kubernetes-cluster-service.json b/components-starter/camel-kubernetes-cluster-service-starter/src/main/docs/kubernetes-cluster-service.json
new file mode 100644
index 00000000000..916c700ba36
--- /dev/null
+++ b/components-starter/camel-kubernetes-cluster-service-starter/src/main/docs/kubernetes-cluster-service.json
@@ -0,0 +1,97 @@
+{
+ "groups": [
+ {
+ "name": "camel.cluster.kubernetes",
+ "type": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration",
+ "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
+ }
+ ],
+ "properties": [
+ {
+ "name": "camel.cluster.kubernetes.attributes",
+ "type": "java.util.Map<java.lang.String,java.lang.Object>",
+ "description": "Custom service attributes.",
+ "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.kubernetes.cluster-labels",
+ "type": "java.util.Map<java.lang.String,java.lang.String>",
+ "description": "Set the labels used to identify the pods composing the cluster.",
+ "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.kubernetes.config-map-name",
+ "type": "java.lang.String",
+ "description": "Set the name of the ConfigMap used to do optimistic locking (defaults to 'leaders').",
+ "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.kubernetes.connection-timeout-millis",
+ "type": "java.lang.Integer",
+ "description": "Connection timeout in milliseconds to use when making requests to the Kubernetes API server.",
+ "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.kubernetes.enabled",
+ "type": "java.lang.Boolean",
+ "description": "Sets if the Kubernetes cluster service should be enabled or not, default is true.",
+ "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration",
+ "defaultValue": true
+ },
+ {
+ "name": "camel.cluster.kubernetes.id",
+ "type": "java.lang.String",
+ "description": "Cluster Service ID",
+ "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.kubernetes.jitter-factor",
+ "type": "java.lang.Double",
+ "description": "A jitter factor to apply in order to prevent all pods to call Kubernetes APIs in the same instant.",
+ "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.kubernetes.kubernetes-namespace",
+ "type": "java.lang.String",
+ "description": "Set the name of the Kubernetes namespace containing the pods and the configmap (autodetected by default)",
+ "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.kubernetes.lease-duration-millis",
+ "type": "java.lang.Long",
+ "description": "The default duration of the lease for the current leader.",
+ "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.kubernetes.master-url",
+ "type": "java.lang.String",
+ "description": "Set the URL of the Kubernetes master (read from Kubernetes client properties by default).",
+ "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.kubernetes.order",
+ "type": "java.lang.Integer",
+ "description": "Service lookup order\/priority.",
+ "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.kubernetes.pod-name",
+ "type": "java.lang.String",
+ "description": "Set the name of the current pod (autodetected from container host name by default).",
+ "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.kubernetes.renew-deadline-millis",
+ "type": "java.lang.Long",
+ "description": "The deadline after which the leader must stop its services because it may have lost the leadership.",
+ "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.kubernetes.retry-period-millis",
+ "type": "java.lang.Long",
+ "description": "The time between two subsequent attempts to check and acquire the leadership. It is randomized using the jitter factor.",
+ "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
+ }
+ ],
+ "hints": []
+}
\ No newline at end of file
diff --git a/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceAutoConfiguration.java b/components-starter/camel-kubernetes-cluster-service-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceAutoConfiguration.java
similarity index 99%
rename from components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceAutoConfiguration.java
rename to components-starter/camel-kubernetes-cluster-service-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceAutoConfiguration.java
index 13ac3533f92..a6ebd07ed21 100644
--- a/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceAutoConfiguration.java
+++ b/components-starter/camel-kubernetes-cluster-service-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceAutoConfiguration.java
@@ -16,6 +16,8 @@
*/
package org.apache.camel.component.kubernetes.springboot.cluster;
+import java.util.Optional;
+
import org.apache.camel.cluster.CamelClusterService;
import org.apache.camel.component.kubernetes.cluster.KubernetesClusterService;
import org.apache.camel.spring.boot.CamelAutoConfiguration;
@@ -29,11 +31,9 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
-import java.util.Optional;
-
@Configuration(proxyBeanMethods = false)
@AutoConfigureBefore({ ClusteredRouteControllerAutoConfiguration.class, CamelAutoConfiguration.class })
-@ConditionalOnProperty(prefix = "camel.cluster.kubernetes", name = "enabled")
+@ConditionalOnProperty(prefix = "camel.cluster.kubernetes", name = "enabled", matchIfMissing = true)
@EnableConfigurationProperties(KubernetesClusterServiceConfiguration.class)
public class KubernetesClusterServiceAutoConfiguration {
diff --git a/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceConfiguration.java b/components-starter/camel-kubernetes-cluster-service-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceConfiguration.java
similarity index 98%
rename from components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceConfiguration.java
rename to components-starter/camel-kubernetes-cluster-service-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceConfiguration.java
index 42e3d15877b..b7a1e6a7b72 100644
--- a/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceConfiguration.java
+++ b/components-starter/camel-kubernetes-cluster-service-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/cluster/KubernetesClusterServiceConfiguration.java
@@ -24,9 +24,9 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
public class KubernetesClusterServiceConfiguration {
/**
- * Sets if the Kubernetes cluster service should be enabled or not, default is false.
+ * Sets if the Kubernetes cluster service should be enabled or not, default is true.
*/
- private boolean enabled;
+ private boolean enabled = true;
/**
* Cluster Service ID
diff --git a/components-starter/camel-kubernetes-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt b/components-starter/camel-kubernetes-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 00000000000..6b0b1270ff0
--- /dev/null
+++ b/components-starter/camel-kubernetes-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/components-starter/camel-kubernetes-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt b/components-starter/camel-kubernetes-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 00000000000..2e215bf2e6b
--- /dev/null
+++ b/components-starter/camel-kubernetes-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-kubernetes-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
similarity index 85%
copy from components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
copy to components-starter/camel-kubernetes-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 6f3c841b357..8377414c0f7 100644
--- a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/components-starter/camel-kubernetes-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -15,5 +15,4 @@
## limitations under the License.
## ---------------------------------------------------------------------------
-org.apache.camel.component.file.springboot.FileComponentAutoConfiguration
-org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceAutoConfiguration
\ No newline at end of file
+org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceAutoConfiguration
diff --git a/components-starter/camel-kubernetes-starter/src/test/java/org/apache/camel/component/kubernetes/springboot/test/cluster/KubernetesClusterServiceAutoConfigurationTest.java b/components-starter/camel-kubernetes-cluster-service-starter/src/test/java/org/apache/camel/component/kubernetes/springboot/test/cluster/KubernetesClusterServiceAutoConfigurationTest.java
similarity index 70%
rename from components-starter/camel-kubernetes-starter/src/test/java/org/apache/camel/component/kubernetes/springboot/test/cluster/KubernetesClusterServiceAutoConfigurationTest.java
rename to components-starter/camel-kubernetes-cluster-service-starter/src/test/java/org/apache/camel/component/kubernetes/springboot/test/cluster/KubernetesClusterServiceAutoConfigurationTest.java
index 4c6fef87b3a..9d0a7d32618 100644
--- a/components-starter/camel-kubernetes-starter/src/test/java/org/apache/camel/component/kubernetes/springboot/test/cluster/KubernetesClusterServiceAutoConfigurationTest.java
+++ b/components-starter/camel-kubernetes-cluster-service-starter/src/test/java/org/apache/camel/component/kubernetes/springboot/test/cluster/KubernetesClusterServiceAutoConfigurationTest.java
@@ -33,8 +33,13 @@ public class KubernetesClusterServiceAutoConfigurationTest {
@Test
public void testDisable() {
new ApplicationContextRunner()
- .withConfiguration(AutoConfigurations.of(KubernetesClusterServiceAutoConfiguration.class))
- .withUserConfiguration(TestConfiguration.class).run(context -> {
+ .withConfiguration(AutoConfigurations.of(KubernetesClusterServiceAutoConfiguration.class))
+ .withUserConfiguration(TestConfiguration.class)
+ .withPropertyValues(
+ "spring.main.banner-mode=off",
+ "camel.cluster.kubernetes.enabled=false")
+ .run(
+ context -> {
assertThat(context).doesNotHaveBean(KubernetesClusterService.class);
});
}
@@ -45,19 +50,23 @@ public class KubernetesClusterServiceAutoConfigurationTest {
@Test
public void testPropertiesMapped() {
new ApplicationContextRunner()
- .withConfiguration(AutoConfigurations.of(KubernetesClusterServiceAutoConfiguration.class))
- .withUserConfiguration(TestConfiguration.class)
- .withPropertyValues("spring.main.banner-mode=off", "camel.cluster.kubernetes.enabled=true",
- "camel.cluster.kubernetes.id=myid1", "camel.cluster.kubernetes.master-url=http://myurl:9000",
- "camel.cluster.kubernetes.connection-timeout-millis=1234",
- "camel.cluster.kubernetes.kubernetes-namespace=ns1",
- "camel.cluster.kubernetes.config-map-name=cm", "camel.cluster.kubernetes.pod-name=mypod1",
- "camel.cluster.kubernetes.cluster-labels.app=myapp",
- "camel.cluster.kubernetes.cluster-labels.provider=myprovider",
- "camel.cluster.kubernetes.lease-duration-millis=10000",
- "camel.cluster.kubernetes.renew-deadline-millis=8000",
- "camel.cluster.kubernetes.retry-period-millis=4000")
- .run(context -> {
+ .withConfiguration(AutoConfigurations.of(KubernetesClusterServiceAutoConfiguration.class))
+ .withUserConfiguration(TestConfiguration.class)
+ .withPropertyValues(
+ "spring.main.banner-mode=off",
+ "camel.cluster.kubernetes.id=myid1",
+ "camel.cluster.kubernetes.master-url=http://myurl:9000",
+ "camel.cluster.kubernetes.connection-timeout-millis=1234",
+ "camel.cluster.kubernetes.kubernetes-namespace=ns1",
+ "camel.cluster.kubernetes.config-map-name=cm",
+ "camel.cluster.kubernetes.pod-name=mypod1",
+ "camel.cluster.kubernetes.cluster-labels.app=myapp",
+ "camel.cluster.kubernetes.cluster-labels.provider=myprovider",
+ "camel.cluster.kubernetes.lease-duration-millis=10000",
+ "camel.cluster.kubernetes.renew-deadline-millis=8000",
+ "camel.cluster.kubernetes.retry-period-millis=4000")
+ .run(
+ context -> {
final KubernetesClusterService clusterService = context.getBean(KubernetesClusterService.class);
assertEquals("myid1", clusterService.getId());
diff --git a/components-starter/camel-kubernetes-cluster-service-starter/src/test/resources/logback.xml b/components-starter/camel-kubernetes-cluster-service-starter/src/test/resources/logback.xml
new file mode 100644
index 00000000000..8ab89a882de
--- /dev/null
+++ b/components-starter/camel-kubernetes-cluster-service-starter/src/test/resources/logback.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<configuration>
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <!-- encoders are assigned the type
+ ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%-15.15thread] %-5level %-30.30logger - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%-15.15thread] %-5level %-30.30logger - %msg%n</pattern>
+ </encoder>
+ <file>target/camel-kubernetes-cluster-service-starter-test.log</file>
+ </appender>
+
+ <root level="INFO">
+ <!--<appender-ref ref="STDOUT"/>-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</configuration>
\ No newline at end of file
diff --git a/components-starter/camel-kubernetes-starter/src/main/docs/kubernetes.json b/components-starter/camel-kubernetes-starter/src/main/docs/kubernetes.json
index 7e82e5bc963..db6ad189530 100644
--- a/components-starter/camel-kubernetes-starter/src/main/docs/kubernetes.json
+++ b/components-starter/camel-kubernetes-starter/src/main/docs/kubernetes.json
@@ -1,10 +1,5 @@
{
"groups": [
- {
- "name": "camel.cluster.kubernetes",
- "type": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration",
- "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
- },
{
"name": "camel.component.kubernetes-config-maps",
"type": "org.apache.camel.component.kubernetes.config_maps.springboot.KubernetesConfigMapsComponentConfiguration",
@@ -227,91 +222,6 @@
}
],
"properties": [
- {
- "name": "camel.cluster.kubernetes.attributes",
- "type": "java.util.Map<java.lang.String,java.lang.Object>",
- "description": "Custom service attributes.",
- "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.kubernetes.cluster-labels",
- "type": "java.util.Map<java.lang.String,java.lang.String>",
- "description": "Set the labels used to identify the pods composing the cluster.",
- "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.kubernetes.config-map-name",
- "type": "java.lang.String",
- "description": "Set the name of the ConfigMap used to do optimistic locking (defaults to 'leaders').",
- "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.kubernetes.connection-timeout-millis",
- "type": "java.lang.Integer",
- "description": "Connection timeout in milliseconds to use when making requests to the Kubernetes API server.",
- "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.kubernetes.enabled",
- "type": "java.lang.Boolean",
- "description": "Sets if the Kubernetes cluster service should be enabled or not, default is false.",
- "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration",
- "defaultValue": false
- },
- {
- "name": "camel.cluster.kubernetes.id",
- "type": "java.lang.String",
- "description": "Cluster Service ID",
- "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.kubernetes.jitter-factor",
- "type": "java.lang.Double",
- "description": "A jitter factor to apply in order to prevent all pods to call Kubernetes APIs in the same instant.",
- "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.kubernetes.kubernetes-namespace",
- "type": "java.lang.String",
- "description": "Set the name of the Kubernetes namespace containing the pods and the configmap (autodetected by default)",
- "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.kubernetes.lease-duration-millis",
- "type": "java.lang.Long",
- "description": "The default duration of the lease for the current leader.",
- "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.kubernetes.master-url",
- "type": "java.lang.String",
- "description": "Set the URL of the Kubernetes master (read from Kubernetes client properties by default).",
- "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.kubernetes.order",
- "type": "java.lang.Integer",
- "description": "Service lookup order\/priority.",
- "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.kubernetes.pod-name",
- "type": "java.lang.String",
- "description": "Set the name of the current pod (autodetected from container host name by default).",
- "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.kubernetes.renew-deadline-millis",
- "type": "java.lang.Long",
- "description": "The deadline after which the leader must stop its services because it may have lost the leadership.",
- "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.kubernetes.retry-period-millis",
- "type": "java.lang.Long",
- "description": "The time between two subsequent attempts to check and acquire the leadership. It is randomized using the jitter factor.",
- "sourceType": "org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceConfiguration"
- },
{
"name": "camel.component.kubernetes-config-maps.autowired-enabled",
"type": "java.lang.Boolean",
diff --git a/components-starter/camel-kubernetes-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-kubernetes-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 375980feed4..ec2d95f7aab 100644
--- a/components-starter/camel-kubernetes-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/components-starter/camel-kubernetes-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -54,7 +54,6 @@ org.apache.camel.component.openshift.build_configs.springboot.OpenshiftBuildConf
org.apache.camel.component.kubernetes.service_accounts.springboot.KubernetesServiceAccountsComponentConverter
org.apache.camel.component.kubernetes.service_accounts.springboot.KubernetesServiceAccountsComponentAutoConfiguration
org.apache.camel.component.kubernetes.springboot.cloud.KubernetesServiceDiscoveryAutoConfiguration
-org.apache.camel.component.kubernetes.springboot.cluster.KubernetesClusterServiceAutoConfiguration
org.apache.camel.component.kubernetes.deployments.springboot.KubernetesDeploymentsComponentAutoConfiguration
org.apache.camel.component.kubernetes.cronjob.springboot.KubernetesCronJobComponentConverter
org.apache.camel.component.kubernetes.cronjob.springboot.KubernetesCronJobComponentAutoConfiguration
diff --git a/components-starter/camel-zookeeper-cluster-service-starter/pom.xml b/components-starter/camel-zookeeper-cluster-service-starter/pom.xml
new file mode 100644
index 00000000000..6bcd7037d12
--- /dev/null
+++ b/components-starter/camel-zookeeper-cluster-service-starter/pom.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>components-starter</artifactId>
+ <version>4.6.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>camel-zookeeper-cluster-service-starter</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel SB Starters :: Zookeeper Cluster Service</name>
+ <description>Spring-Boot Starter for Camel Cluster Service based on Zookeeper</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <version>${spring-boot-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-zookeeper-starter</artifactId>
+ <version>${camel-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.curator</groupId>
+ <artifactId>curator-test</artifactId>
+ <version>${curator-version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.zookeeper</groupId>
+ <artifactId>zookeeper</artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>test</scope>
+ </dependency>
+ <!--START OF GENERATED CODE-->
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-core-starter</artifactId>
+ </dependency>
+ <!--END OF GENERATED CODE-->
+ </dependencies>
+</project>
diff --git a/components-starter/camel-zookeeper-cluster-service-starter/src/main/docs/zookeeper-cluster-service.json b/components-starter/camel-zookeeper-cluster-service-starter/src/main/docs/zookeeper-cluster-service.json
new file mode 100644
index 00000000000..88285e50b24
--- /dev/null
+++ b/components-starter/camel-zookeeper-cluster-service-starter/src/main/docs/zookeeper-cluster-service.json
@@ -0,0 +1,144 @@
+{
+ "groups": [
+ {
+ "name": "camel.cluster.zookeeper",
+ "type": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ }
+ ],
+ "properties": [
+ {
+ "name": "camel.cluster.zookeeper.attributes",
+ "type": "java.util.Map<java.lang.String,java.lang.Object>",
+ "description": "Custom service attributes.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.zookeeper.auth-info-list",
+ "type": "java.util.List<org.apache.curator.framework.AuthInfo>",
+ "description": "List of AuthInfo objects with scheme and auth.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.zookeeper.base-path",
+ "type": "java.lang.String",
+ "description": "The base path to store in ZooKeeper.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.zookeeper.connection-timeout",
+ "type": "java.lang.Long",
+ "description": "Connection timeout.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration",
+ "defaultValue": 15000
+ },
+ {
+ "name": "camel.cluster.zookeeper.connection-timeout-unit",
+ "type": "java.util.concurrent.TimeUnit",
+ "description": "Connection timeout TimeUnit. Default is TimeUnit.MILLISECONDS.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.zookeeper.curator-framework",
+ "type": "org.apache.curator.framework.CuratorFramework",
+ "description": "Zookeeper CuratorFramework-style client.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.zookeeper.enabled",
+ "type": "java.lang.Boolean",
+ "description": "Sets if the zookeeper cluster service should be enabled or not, default is true.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration",
+ "defaultValue": true
+ },
+ {
+ "name": "camel.cluster.zookeeper.id",
+ "type": "java.lang.String",
+ "description": "Cluster Service ID",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.zookeeper.max-close-wait",
+ "type": "java.lang.Long",
+ "description": "Time to wait during close to join background threads.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration",
+ "defaultValue": 1000
+ },
+ {
+ "name": "camel.cluster.zookeeper.max-close-wait-unit",
+ "type": "java.util.concurrent.TimeUnit",
+ "description": "MaxCloseWait TimeUnit. Default is TimeUnit.MILLISECONDS.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.zookeeper.namespace",
+ "type": "java.lang.String",
+ "description": "ZooKeeper namespace. If a namespace is set here, all paths will get pre-pended with the namespace.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.zookeeper.nodes",
+ "type": "java.util.List<java.lang.String>",
+ "description": "The Zookeeper server hosts (multiple servers can be separated by comma).",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.zookeeper.order",
+ "type": "java.lang.Integer",
+ "description": "Service lookup order\/priority.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.zookeeper.reconnect-base-sleep-time",
+ "type": "java.lang.Long",
+ "description": "Initial amount of time to wait between retries.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration",
+ "defaultValue": 0
+ },
+ {
+ "name": "camel.cluster.zookeeper.reconnect-base-sleep-time-unit",
+ "type": "java.util.concurrent.TimeUnit",
+ "description": "ReconnectBaseSleepTime TimeUnit. Default is TimeUnit.MILLISECONDS.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.zookeeper.reconnect-max-retries",
+ "type": "java.lang.Integer",
+ "description": "Max number of times to retry.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration",
+ "defaultValue": 3
+ },
+ {
+ "name": "camel.cluster.zookeeper.reconnect-max-sleep-time",
+ "type": "java.lang.Long",
+ "description": "Max time to sleep on each retry. Default is Integer.MAX_VALUE.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.zookeeper.reconnect-max-sleep-time-unit",
+ "type": "java.util.concurrent.TimeUnit",
+ "description": "ReconnectMaxSleepTimeUnit TimeUnit. Default is TimeUnit.MILLISECONDS.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.zookeeper.retry-policy",
+ "type": "org.apache.curator.RetryPolicy",
+ "description": "Retry policy to use.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ },
+ {
+ "name": "camel.cluster.zookeeper.session-timeout",
+ "type": "java.lang.Long",
+ "description": "Session timeout.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration",
+ "defaultValue": 60000
+ },
+ {
+ "name": "camel.cluster.zookeeper.session-timeout-unit",
+ "type": "java.util.concurrent.TimeUnit",
+ "description": "Session timeout TimeUnit. Default is TimeUnit.MILLISECONDS.",
+ "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
+ }
+ ],
+ "hints": []
+}
\ No newline at end of file
diff --git a/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceAutoConfiguration.java b/components-starter/camel-zookeeper-cluster-service-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceAutoConfiguration.java
similarity index 99%
rename from components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceAutoConfiguration.java
rename to components-starter/camel-zookeeper-cluster-service-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceAutoConfiguration.java
index 9278a43e029..0cebc9f1d09 100644
--- a/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceAutoConfiguration.java
+++ b/components-starter/camel-zookeeper-cluster-service-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceAutoConfiguration.java
@@ -33,7 +33,7 @@ import java.util.Optional;
@Configuration
@AutoConfigureBefore({ ClusteredRouteControllerAutoConfiguration.class, CamelAutoConfiguration.class })
-@ConditionalOnProperty(prefix = "camel.cluster.zookeeper", name = "enabled")
+@ConditionalOnProperty(prefix = "camel.cluster.zookeeper", name = "enabled", matchIfMissing = true)
@EnableConfigurationProperties(ZooKeeperClusterServiceConfiguration.class)
public class ZooKeeperClusterServiceAutoConfiguration {
diff --git a/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceConfiguration.java b/components-starter/camel-zookeeper-cluster-service-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceConfiguration.java
similarity index 98%
rename from components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceConfiguration.java
rename to components-starter/camel-zookeeper-cluster-service-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceConfiguration.java
index f4469ceb9ee..9c8651a17eb 100644
--- a/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceConfiguration.java
+++ b/components-starter/camel-zookeeper-cluster-service-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceConfiguration.java
@@ -29,9 +29,9 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "camel.cluster.zookeeper")
public class ZooKeeperClusterServiceConfiguration extends ZooKeeperCuratorConfiguration {
/**
- * Sets if the zookeeper cluster service should be enabled or not, default is false.
+ * Sets if the zookeeper cluster service should be enabled or not, default is true.
*/
- private boolean enabled = false;
+ private boolean enabled = true;
/**
* Cluster Service ID
diff --git a/components-starter/camel-zookeeper-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt b/components-starter/camel-zookeeper-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 00000000000..6b0b1270ff0
--- /dev/null
+++ b/components-starter/camel-zookeeper-cluster-service-starter/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/components-starter/camel-zookeeper-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt b/components-starter/camel-zookeeper-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 00000000000..2e215bf2e6b
--- /dev/null
+++ b/components-starter/camel-zookeeper-cluster-service-starter/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-zookeeper-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
similarity index 85%
copy from components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
copy to components-starter/camel-zookeeper-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 6f3c841b357..1c867baba86 100644
--- a/components-starter/camel-file-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/components-starter/camel-zookeeper-cluster-service-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -15,5 +15,4 @@
## limitations under the License.
## ---------------------------------------------------------------------------
-org.apache.camel.component.file.springboot.FileComponentAutoConfiguration
-org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceAutoConfiguration
\ No newline at end of file
+org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceAutoConfiguration
\ No newline at end of file
diff --git a/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceTest.java b/components-starter/camel-zookeeper-cluster-service-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceTest.java
similarity index 69%
rename from components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceTest.java
rename to components-starter/camel-zookeeper-cluster-service-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceTest.java
index 8e5f60fd8e4..d70a731b3b4 100644
--- a/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceTest.java
+++ b/components-starter/camel-zookeeper-cluster-service-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceTest.java
@@ -27,6 +27,7 @@ import org.apache.camel.test.AvailablePortFinder;
import org.apache.curator.test.TestingServer;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
+import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Configuration;
@@ -39,40 +40,50 @@ public class ZooKeeperClusterServiceTest {
@TempDir
Path temporaryFolder;
+
+ @Test
+ public void testDisable() {
+ new ApplicationContextRunner()
+ .withConfiguration(AutoConfigurations.of(ZooKeeperClusterServiceAutoConfiguration.class))
+ .withUserConfiguration(TestConfiguration.class)
+ .withPropertyValues(
+ "spring.main.banner-mode=off",
+ "camel.cluster.zookeeper.enabled=false")
+ .run(
+ context -> {
+ assertThat(context).doesNotHaveBean(ZooKeeperClusterService.class);
+ });
+ }
+
@Test
public void testClusterService() throws Exception {
final int zkPort = AvailablePortFinder.getNextAvailable();
final File zkDir = temporaryFolder.toFile();
- final TestingServer zkServer = new TestingServer(zkPort, zkDir);
- zkServer.start();
+ try (TestingServer zkServer = new TestingServer(zkPort, zkDir)) {
+ zkServer.start();
- try {
new ApplicationContextRunner().withUserConfiguration(TestConfiguration.class)
- .withPropertyValues("debug=false", "spring.main.banner-mode=OFF",
- "spring.application.name=" + UUID.randomUUID(), "camel.cluster.zookeeper.enabled=true",
- "camel.cluster.zookeeper.nodes=localhost:" + zkPort,
- "camel.cluster.zookeeper.id=" + UUID.randomUUID(),
- "camel.cluster.zookeeper.base-path=" + SERVICE_PATH)
+ .withPropertyValues(
+ "spring.main.banner-mode=OFF",
+ "spring.application.name=" + UUID.randomUUID(),
+ "camel.cluster.zookeeper.nodes=localhost:" + zkPort,
+ "camel.cluster.zookeeper.id=" + UUID.randomUUID(),
+ "camel.cluster.zookeeper.base-path=" + SERVICE_PATH)
.run(context -> {
assertThat(context).hasSingleBean(CamelContext.class);
assertThat(context).hasSingleBean(CamelClusterService.class);
- final CamelContext camelContext = context.getBean(CamelContext.class);
final CamelClusterService clusterService = context.getBean(CamelClusterService.class);
+
assertThat(clusterService).isNotNull();
clusterService.start();
+
assertThat(clusterService).isInstanceOf(ZooKeeperClusterService.class);
});
- } finally {
- zkServer.stop();
}
}
- // *************************************
- // Config
- // *************************************
-
@EnableAutoConfiguration
@Configuration
public static class TestConfiguration {
diff --git a/components-starter/camel-zookeeper-cluster-service-starter/src/test/resources/logback.xml b/components-starter/camel-zookeeper-cluster-service-starter/src/test/resources/logback.xml
new file mode 100644
index 00000000000..c2d17c45149
--- /dev/null
+++ b/components-starter/camel-zookeeper-cluster-service-starter/src/test/resources/logback.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<configuration>
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <!-- encoders are assigned the type
+ ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%-15.15thread] %-5level %-30.30logger - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} [%-15.15thread] %-5level %-30.30logger - %msg%n</pattern>
+ </encoder>
+ <file>target/camel-zookeeper-cluster-service-starter-test.log</file>
+ </appender>
+
+ <root level="INFO">
+ <!--<appender-ref ref="STDOUT"/>-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</configuration>
\ No newline at end of file
diff --git a/components-starter/camel-zookeeper-starter/src/main/docs/zookeeper.json b/components-starter/camel-zookeeper-starter/src/main/docs/zookeeper.json
index 6c10ffccaf7..0c6c3623683 100644
--- a/components-starter/camel-zookeeper-starter/src/main/docs/zookeeper.json
+++ b/components-starter/camel-zookeeper-starter/src/main/docs/zookeeper.json
@@ -5,11 +5,6 @@
"type": "org.apache.camel.component.zookeeper.springboot.cloud.ZooKeeperServiceRegistryConfiguration",
"sourceType": "org.apache.camel.component.zookeeper.springboot.cloud.ZooKeeperServiceRegistryConfiguration"
},
- {
- "name": "camel.cluster.zookeeper",
- "type": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
{
"name": "camel.component.zookeeper",
"type": "org.apache.camel.component.zookeeper.springboot.ZooKeeperComponentConfiguration",
@@ -175,138 +170,6 @@
"description": "Session timeout TimeUnit. Default is TimeUnit.MILLISECONDS.",
"sourceType": "org.apache.camel.component.zookeeper.springboot.cloud.ZooKeeperServiceRegistryConfiguration"
},
- {
- "name": "camel.cluster.zookeeper.attributes",
- "type": "java.util.Map<java.lang.String,java.lang.Object>",
- "description": "Custom service attributes.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.zookeeper.auth-info-list",
- "type": "java.util.List<org.apache.curator.framework.AuthInfo>",
- "description": "List of AuthInfo objects with scheme and auth.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.zookeeper.base-path",
- "type": "java.lang.String",
- "description": "The base path to store in ZooKeeper.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.zookeeper.connection-timeout",
- "type": "java.lang.Long",
- "description": "Connection timeout.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration",
- "defaultValue": 15000
- },
- {
- "name": "camel.cluster.zookeeper.connection-timeout-unit",
- "type": "java.util.concurrent.TimeUnit",
- "description": "Connection timeout TimeUnit. Default is TimeUnit.MILLISECONDS.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.zookeeper.curator-framework",
- "type": "org.apache.curator.framework.CuratorFramework",
- "description": "Zookeeper CuratorFramework-style client.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.zookeeper.enabled",
- "type": "java.lang.Boolean",
- "description": "Sets if the zookeeper cluster service should be enabled or not, default is false.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration",
- "defaultValue": false
- },
- {
- "name": "camel.cluster.zookeeper.id",
- "type": "java.lang.String",
- "description": "Cluster Service ID",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.zookeeper.max-close-wait",
- "type": "java.lang.Long",
- "description": "Time to wait during close to join background threads.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration",
- "defaultValue": 1000
- },
- {
- "name": "camel.cluster.zookeeper.max-close-wait-unit",
- "type": "java.util.concurrent.TimeUnit",
- "description": "MaxCloseWait TimeUnit. Default is TimeUnit.MILLISECONDS.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.zookeeper.namespace",
- "type": "java.lang.String",
- "description": "ZooKeeper namespace. If a namespace is set here, all paths will get pre-pended with the namespace.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.zookeeper.nodes",
- "type": "java.util.List<java.lang.String>",
- "description": "The Zookeeper server hosts (multiple servers can be separated by comma).",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.zookeeper.order",
- "type": "java.lang.Integer",
- "description": "Service lookup order\/priority.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.zookeeper.reconnect-base-sleep-time",
- "type": "java.lang.Long",
- "description": "Initial amount of time to wait between retries.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration",
- "defaultValue": 0
- },
- {
- "name": "camel.cluster.zookeeper.reconnect-base-sleep-time-unit",
- "type": "java.util.concurrent.TimeUnit",
- "description": "ReconnectBaseSleepTime TimeUnit. Default is TimeUnit.MILLISECONDS.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.zookeeper.reconnect-max-retries",
- "type": "java.lang.Integer",
- "description": "Max number of times to retry.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration",
- "defaultValue": 3
- },
- {
- "name": "camel.cluster.zookeeper.reconnect-max-sleep-time",
- "type": "java.lang.Long",
- "description": "Max time to sleep on each retry. Default is Integer.MAX_VALUE.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.zookeeper.reconnect-max-sleep-time-unit",
- "type": "java.util.concurrent.TimeUnit",
- "description": "ReconnectMaxSleepTimeUnit TimeUnit. Default is TimeUnit.MILLISECONDS.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.zookeeper.retry-policy",
- "type": "org.apache.curator.RetryPolicy",
- "description": "Retry policy to use.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
- {
- "name": "camel.cluster.zookeeper.session-timeout",
- "type": "java.lang.Long",
- "description": "Session timeout.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration",
- "defaultValue": 60000
- },
- {
- "name": "camel.cluster.zookeeper.session-timeout-unit",
- "type": "java.util.concurrent.TimeUnit",
- "description": "Session timeout TimeUnit. Default is TimeUnit.MILLISECONDS.",
- "sourceType": "org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceConfiguration"
- },
{
"name": "camel.component.zookeeper.autowired-enabled",
"type": "java.lang.Boolean",
diff --git a/components-starter/camel-zookeeper-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/components-starter/camel-zookeeper-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 7de1ae48b2a..a023896faa1 100644
--- a/components-starter/camel-zookeeper-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/components-starter/camel-zookeeper-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -17,5 +17,4 @@
org.apache.camel.component.zookeeper.springboot.ZooKeeperComponentConverter
org.apache.camel.component.zookeeper.springboot.ZooKeeperComponentAutoConfiguration
-org.apache.camel.component.zookeeper.springboot.cloud.ZooKeeperServiceRegistryAutoConfiguration
-org.apache.camel.component.zookeeper.springboot.cluster.ZooKeeperClusterServiceAutoConfiguration
\ No newline at end of file
+org.apache.camel.component.zookeeper.springboot.cloud.ZooKeeperServiceRegistryAutoConfiguration
\ No newline at end of file
diff --git a/components-starter/pom.xml b/components-starter/pom.xml
index 9805dacbc34..87820230891 100644
--- a/components-starter/pom.xml
+++ b/components-starter/pom.xml
@@ -103,7 +103,7 @@
</plugins>
</build>
<modules>
-
+
<module>camel-activemq-starter</module>
<module>camel-amqp-starter</module>
<module>camel-arangodb-starter</module>
@@ -169,6 +169,7 @@
<module>camel-coap-starter</module>
<module>camel-cometd-starter</module>
<module>camel-console-starter</module>
+ <module>camel-consul-cluster-service-starter</module>
<module>camel-consul-starter</module>
<module>camel-controlbus-starter</module>
<module>camel-core-starter</module>
@@ -208,6 +209,7 @@
<module>camel-exec-starter</module>
<module>camel-fastjson-starter</module>
<module>camel-fhir-starter</module>
+ <module>camel-file-cluster-service-starter</module>
<module>camel-file-starter</module>
<module>camel-file-watch-starter</module>
<module>camel-flatpack-starter</module>
@@ -249,6 +251,7 @@
<module>camel-ical-starter</module>
<module>camel-iec60870-starter</module>
<module>camel-ignite-starter</module>
+ <module>camel-infinispan-cluster-service-starter</module>
<module>camel-infinispan-embedded-starter</module>
<module>camel-infinispan-starter</module>
<module>camel-influxdb-starter</module>
@@ -267,6 +270,8 @@
<module>camel-jdbc-starter</module>
<module>camel-jetty-starter</module>
<module>camel-jfr-starter</module>
+ <module>camel-jgroups-cluster-service-starter</module>
+ <module>camel-jgroups-raft-cluster-service-starter</module>
<module>camel-jgroups-raft-starter</module>
<module>camel-jgroups-starter</module>
<module>camel-jira-starter</module>
@@ -291,6 +296,7 @@
<module>camel-kamelet-starter</module>
<module>camel-knative-starter</module>
<module>camel-kubernetes-starter</module>
+ <module>camel-kubernetes-cluster-service-starter</module>
<module>camel-kudu-starter</module>
<module>camel-langchain4j-chat-starter</module>
<module>camel-langchain4j-embeddings-starter</module>
@@ -436,6 +442,7 @@
<module>camel-zendesk-starter</module>
<module>camel-zip-deflater-starter</module>
<module>camel-zipfile-starter</module>
+ <module>camel-zookeeper-cluster-service-starter</module>
<module>camel-zookeeper-master-starter</module>
<module>camel-zookeeper-starter</module>
</modules>
diff --git a/tooling/camel-spring-boot-bom/pom.xml b/tooling/camel-spring-boot-bom/pom.xml
index dd0c45eaa88..1889969b4aa 100644
--- a/tooling/camel-spring-boot-bom/pom.xml
+++ b/tooling/camel-spring-boot-bom/pom.xml
@@ -368,6 +368,11 @@
<artifactId>camel-console-starter</artifactId>
<version>4.6.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-consul-cluster-service-starter</artifactId>
+ <version>4.6.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-consul-starter</artifactId>
@@ -573,6 +578,11 @@
<artifactId>camel-fhir-starter</artifactId>
<version>4.6.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-file-cluster-service-starter</artifactId>
+ <version>4.6.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-file-starter</artifactId>
@@ -783,6 +793,11 @@
<artifactId>camel-ignite-starter</artifactId>
<version>4.6.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-infinispan-cluster-service-starter</artifactId>
+ <version>4.6.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-infinispan-embedded-starter</artifactId>
@@ -878,6 +893,16 @@
<artifactId>camel-jfr-starter</artifactId>
<version>4.6.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-jgroups-cluster-service-starter</artifactId>
+ <version>4.6.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-jgroups-raft-cluster-service-starter</artifactId>
+ <version>4.6.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-jgroups-raft-starter</artifactId>
@@ -1018,6 +1043,11 @@
<artifactId>camel-kotlin-dsl-starter</artifactId>
<version>4.6.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-kubernetes-cluster-service-starter</artifactId>
+ <version>4.6.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-kubernetes-starter</artifactId>
@@ -1793,6 +1823,11 @@
<artifactId>camel-zipfile-starter</artifactId>
<version>4.6.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-zookeeper-cluster-service-starter</artifactId>
+ <version>4.6.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-zookeeper-master-starter</artifactId>
diff --git a/tooling/camel-spring-boot-dependencies/pom.xml b/tooling/camel-spring-boot-dependencies/pom.xml
index 2f2a0555dff..b13402f75dd 100644
--- a/tooling/camel-spring-boot-dependencies/pom.xml
+++ b/tooling/camel-spring-boot-dependencies/pom.xml
@@ -612,6 +612,11 @@
<artifactId>camel-console-starter</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-consul-cluster-service-starter</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-consul-starter</artifactId>
@@ -817,6 +822,11 @@
<artifactId>camel-fhir-starter</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-file-cluster-service-starter</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-file-starter</artifactId>
@@ -1027,6 +1037,11 @@
<artifactId>camel-ignite-starter</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-infinispan-cluster-service-starter</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-infinispan-embedded-starter</artifactId>
@@ -1122,6 +1137,16 @@
<artifactId>camel-jfr-starter</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-jgroups-cluster-service-starter</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-jgroups-raft-cluster-service-starter</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-jgroups-raft-starter</artifactId>
@@ -1257,6 +1282,11 @@
<artifactId>camel-kotlin-dsl-starter</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-kubernetes-cluster-service-starter</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-kubernetes-starter</artifactId>
@@ -2022,6 +2052,11 @@
<artifactId>camel-zipfile-starter</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.springboot</groupId>
+ <artifactId>camel-zookeeper-cluster-service-starter</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-zookeeper-master-starter</artifactId>
diff --git a/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootStarterMojo.java b/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootStarterMojo.java
index de4b2765c84..7a016385ed9 100644
--- a/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootStarterMojo.java
+++ b/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootStarterMojo.java
@@ -287,6 +287,10 @@ public class SpringBootStarterMojo extends AbstractSpringBootGenerator {
Set<Artifact> dependencies;
try {
Artifact artifact = project.getArtifactMap().get(getMainDepGroupId() + ":" + getMainDepArtifactId());
+ if (artifact == null) {
+ return Collections.emptySet();
+ }
+
ProjectBuildingResult result = projectBuilder.build(artifact, project.getProjectBuildingRequest());
MavenProject prj = result.getProject();
prj.setRemoteArtifactRepositories(project.getRemoteArtifactRepositories());