You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/04/16 07:48:54 UTC

[camel-spring-boot] 10/11: CAMEL-16520: camel-spring-boot - Auto configuration options for cloud and cluster should not clash with component

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

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

commit 69eba59dc6e25b12cc502907d196165eac7be770
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Apr 16 09:43:56 2021 +0200

    CAMEL-16520: camel-spring-boot - Auto configuration options for cloud and cluster should not clash with component
---
 .../src/main/docs/zookeeper-starter.adoc           | 90 +++++++++++-----------
 .../ZooKeeperServiceRegistryAutoConfiguration.java |  2 +-
 .../ZooKeeperServiceRegistryConfiguration.java     |  2 +-
 .../ZooKeeperClusterServiceAutoConfiguration.java  |  2 +-
 .../ZooKeeperClusterServiceConfiguration.java      |  2 +-
 .../cloud/ZooKeeperServiceRegistryTest.java        | 10 +--
 .../cluster/ZooKeeperClusterServiceTest.java       | 10 +--
 7 files changed, 59 insertions(+), 59 deletions(-)

diff --git a/components-starter/camel-zookeeper-starter/src/main/docs/zookeeper-starter.adoc b/components-starter/camel-zookeeper-starter/src/main/docs/zookeeper-starter.adoc
index cd49f15..1f6f2dd 100644
--- a/components-starter/camel-zookeeper-starter/src/main/docs/zookeeper-starter.adoc
+++ b/components-starter/camel-zookeeper-starter/src/main/docs/zookeeper-starter.adoc
@@ -24,30 +24,54 @@ The component supports 57 options, which are listed below.
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
+| *camel.cloud.zookeeper.attributes* | Custom service attributes. |  | Map
+| *camel.cloud.zookeeper.auth-info-list* | List of AuthInfo objects with scheme and auth. |  | List
+| *camel.cloud.zookeeper.base-path* | The base path to store in ZooKeeper. |  | String
+| *camel.cloud.zookeeper.connection-timeout* | Connection timeout. | 15000 | Long
+| *camel.cloud.zookeeper.connection-timeout-unit* | Connection timeout TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
+| *camel.cloud.zookeeper.curator-framework* | Zookeeper CuratorFramework-style client. |  | CuratorFramework
+| *camel.cloud.zookeeper.deregister-services-on-stop* | Should we remove all the registered services know by this registry on stop ?  Default is true. | true | Boolean
+| *camel.cloud.zookeeper.enabled* | Sets if the zookeeper service registry should be enabled or not, default is false. | false | Boolean
+| *camel.cloud.zookeeper.id* | Service Registry ID |  | String
+| *camel.cloud.zookeeper.max-close-wait* | Time to wait during close to join background threads. | 1000 | Long
+| *camel.cloud.zookeeper.max-close-wait-unit* | MaxCloseWait TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
+| *camel.cloud.zookeeper.namespace* | ZooKeeper namespace. If a namespace is set here, all paths will get pre-pended with the namespace. |  | String
+| *camel.cloud.zookeeper.nodes* | The Zookeeper server hosts (multiple servers can be separated by comma). |  | List
+| *camel.cloud.zookeeper.order* | Service lookup order/priority. |  | Integer
+| *camel.cloud.zookeeper.override-service-host* | Should we override the service host if given ?  Default is true. | true | Boolean
+| *camel.cloud.zookeeper.reconnect-base-sleep-time* | Initial amount of time to wait between retries. | 0 | Long
+| *camel.cloud.zookeeper.reconnect-base-sleep-time-unit* | ReconnectBaseSleepTime TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
+| *camel.cloud.zookeeper.reconnect-max-retries* | Max number of times to retry. | 3 | Integer
+| *camel.cloud.zookeeper.reconnect-max-sleep-time* | Max time to sleep on each retry. Default is Integer.MAX_VALUE. |  | Long
+| *camel.cloud.zookeeper.reconnect-max-sleep-time-unit* | ReconnectMaxSleepTimeUnit TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
+| *camel.cloud.zookeeper.retry-policy* | Retry policy to use. |  | RetryPolicy
+| *camel.cloud.zookeeper.service-host* | Service host. |  | String
+| *camel.cloud.zookeeper.session-timeout* | Session timeout. | 60000 | Long
+| *camel.cloud.zookeeper.session-timeout-unit* | Session timeout TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
+| *camel.cluster.zookeeper.attributes* | Custom service attributes. |  | Map
+| *camel.cluster.zookeeper.auth-info-list* | List of AuthInfo objects with scheme and auth. |  | List
+| *camel.cluster.zookeeper.base-path* | The base path to store in ZooKeeper. |  | String
+| *camel.cluster.zookeeper.connection-timeout* | Connection timeout. | 15000 | Long
+| *camel.cluster.zookeeper.connection-timeout-unit* | Connection timeout TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
+| *camel.cluster.zookeeper.curator-framework* | Zookeeper CuratorFramework-style client. |  | CuratorFramework
+| *camel.cluster.zookeeper.enabled* | Sets if the zookeeper cluster service should be enabled or not, default is false. | false | Boolean
+| *camel.cluster.zookeeper.id* | Cluster Service ID |  | String
+| *camel.cluster.zookeeper.max-close-wait* | Time to wait during close to join background threads. | 1000 | Long
+| *camel.cluster.zookeeper.max-close-wait-unit* | MaxCloseWait TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
+| *camel.cluster.zookeeper.namespace* | ZooKeeper namespace. If a namespace is set here, all paths will get pre-pended with the namespace. |  | String
+| *camel.cluster.zookeeper.nodes* | The Zookeeper server hosts (multiple servers can be separated by comma). |  | List
+| *camel.cluster.zookeeper.order* | Service lookup order/priority. |  | Integer
+| *camel.cluster.zookeeper.reconnect-base-sleep-time* | Initial amount of time to wait between retries. | 0 | Long
+| *camel.cluster.zookeeper.reconnect-base-sleep-time-unit* | ReconnectBaseSleepTime TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
+| *camel.cluster.zookeeper.reconnect-max-retries* | Max number of times to retry. | 3 | Integer
+| *camel.cluster.zookeeper.reconnect-max-sleep-time* | Max time to sleep on each retry. Default is Integer.MAX_VALUE. |  | Long
+| *camel.cluster.zookeeper.reconnect-max-sleep-time-unit* | ReconnectMaxSleepTimeUnit TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
+| *camel.cluster.zookeeper.retry-policy* | Retry policy to use. |  | RetryPolicy
+| *camel.cluster.zookeeper.session-timeout* | Session timeout. | 60000 | Long
+| *camel.cluster.zookeeper.session-timeout-unit* | Session timeout TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
 | *camel.component.zookeeper.autowired-enabled* | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | Boolean
 | *camel.component.zookeeper.backoff* | The time interval to backoff for after an error before retrying. | 5000 | Long
 | *camel.component.zookeeper.bridge-error-handler* | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | Boolean
-| *camel.component.zookeeper.cluster.service.attributes* | Custom service attributes. |  | Map
-| *camel.component.zookeeper.cluster.service.auth-info-list* | List of AuthInfo objects with scheme and auth. |  | List
-| *camel.component.zookeeper.cluster.service.base-path* | The base path to store in ZooKeeper. |  | String
-| *camel.component.zookeeper.cluster.service.connection-timeout* | Connection timeout. | 15000 | Long
-| *camel.component.zookeeper.cluster.service.connection-timeout-unit* | Connection timeout TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
-| *camel.component.zookeeper.cluster.service.curator-framework* | Zookeeper CuratorFramework-style client. |  | CuratorFramework
-| *camel.component.zookeeper.cluster.service.enabled* | Sets if the zookeeper cluster service should be enabled or not, default is false. | false | Boolean
-| *camel.component.zookeeper.cluster.service.id* | Cluster Service ID |  | String
-| *camel.component.zookeeper.cluster.service.max-close-wait* | Time to wait during close to join background threads. | 1000 | Long
-| *camel.component.zookeeper.cluster.service.max-close-wait-unit* | MaxCloseWait TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
-| *camel.component.zookeeper.cluster.service.namespace* | ZooKeeper namespace. If a namespace is set here, all paths will get pre-pended with the namespace. |  | String
-| *camel.component.zookeeper.cluster.service.nodes* | The Zookeeper server hosts (multiple servers can be separated by comma). |  | List
-| *camel.component.zookeeper.cluster.service.order* | Service lookup order/priority. |  | Integer
-| *camel.component.zookeeper.cluster.service.reconnect-base-sleep-time* | Initial amount of time to wait between retries. | 0 | Long
-| *camel.component.zookeeper.cluster.service.reconnect-base-sleep-time-unit* | ReconnectBaseSleepTime TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
-| *camel.component.zookeeper.cluster.service.reconnect-max-retries* | Max number of times to retry. | 3 | Integer
-| *camel.component.zookeeper.cluster.service.reconnect-max-sleep-time* | Max time to sleep on each retry. Default is Integer.MAX_VALUE. |  | Long
-| *camel.component.zookeeper.cluster.service.reconnect-max-sleep-time-unit* | ReconnectMaxSleepTimeUnit TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
-| *camel.component.zookeeper.cluster.service.retry-policy* | Retry policy to use. |  | RetryPolicy
-| *camel.component.zookeeper.cluster.service.session-timeout* | Session timeout. | 60000 | Long
-| *camel.component.zookeeper.cluster.service.session-timeout-unit* | Session timeout TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
 | *camel.component.zookeeper.configuration* | To use a shared ZooKeeperConfiguration. The option is a org.apache.camel.component.zookeeper.ZooKeeperConfiguration type. |  | ZooKeeperConfiguration
 | *camel.component.zookeeper.create* | Should the endpoint create the node if it does not currently exist. | false | Boolean
 | *camel.component.zookeeper.create-mode* | The create mode that should be used for the newly created node | EPHEMERAL | String
@@ -56,30 +80,6 @@ The component supports 57 options, which are listed below.
 | *camel.component.zookeeper.list-children* | Whether the children of the node should be listed | false | Boolean
 | *camel.component.zookeeper.repeat* | Should changes to the znode be 'watched' and repeatedly processed. | false | Boolean
 | *camel.component.zookeeper.send-empty-message-on-delete* | Upon the delete of a znode, should an empty message be send to the consumer | true | Boolean
-| *camel.component.zookeeper.service-registry.attributes* | Custom service attributes. |  | Map
-| *camel.component.zookeeper.service-registry.auth-info-list* | List of AuthInfo objects with scheme and auth. |  | List
-| *camel.component.zookeeper.service-registry.base-path* | The base path to store in ZooKeeper. |  | String
-| *camel.component.zookeeper.service-registry.connection-timeout* | Connection timeout. | 15000 | Long
-| *camel.component.zookeeper.service-registry.connection-timeout-unit* | Connection timeout TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
-| *camel.component.zookeeper.service-registry.curator-framework* | Zookeeper CuratorFramework-style client. |  | CuratorFramework
-| *camel.component.zookeeper.service-registry.deregister-services-on-stop* | Should we remove all the registered services know by this registry on stop ?  Default is true. | true | Boolean
-| *camel.component.zookeeper.service-registry.enabled* | Sets if the zookeeper service registry should be enabled or not, default is false. | false | Boolean
-| *camel.component.zookeeper.service-registry.id* | Service Registry ID |  | String
-| *camel.component.zookeeper.service-registry.max-close-wait* | Time to wait during close to join background threads. | 1000 | Long
-| *camel.component.zookeeper.service-registry.max-close-wait-unit* | MaxCloseWait TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
-| *camel.component.zookeeper.service-registry.namespace* | ZooKeeper namespace. If a namespace is set here, all paths will get pre-pended with the namespace. |  | String
-| *camel.component.zookeeper.service-registry.nodes* | The Zookeeper server hosts (multiple servers can be separated by comma). |  | List
-| *camel.component.zookeeper.service-registry.order* | Service lookup order/priority. |  | Integer
-| *camel.component.zookeeper.service-registry.override-service-host* | Should we override the service host if given ?  Default is true. | true | Boolean
-| *camel.component.zookeeper.service-registry.reconnect-base-sleep-time* | Initial amount of time to wait between retries. | 0 | Long
-| *camel.component.zookeeper.service-registry.reconnect-base-sleep-time-unit* | ReconnectBaseSleepTime TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
-| *camel.component.zookeeper.service-registry.reconnect-max-retries* | Max number of times to retry. | 3 | Integer
-| *camel.component.zookeeper.service-registry.reconnect-max-sleep-time* | Max time to sleep on each retry. Default is Integer.MAX_VALUE. |  | Long
-| *camel.component.zookeeper.service-registry.reconnect-max-sleep-time-unit* | ReconnectMaxSleepTimeUnit TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
-| *camel.component.zookeeper.service-registry.retry-policy* | Retry policy to use. |  | RetryPolicy
-| *camel.component.zookeeper.service-registry.service-host* | Service host. |  | String
-| *camel.component.zookeeper.service-registry.session-timeout* | Session timeout. | 60000 | Long
-| *camel.component.zookeeper.service-registry.session-timeout-unit* | Session timeout TimeUnit. Default is TimeUnit.MILLISECONDS. |  | TimeUnit
 | *camel.component.zookeeper.timeout* | The time interval to wait on connection before timing out. | 5000 | Integer
 |===
 // spring-boot-auto-configure options: END
diff --git a/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryAutoConfiguration.java b/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryAutoConfiguration.java
index 2fccb4a..d96b4fe 100644
--- a/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryAutoConfiguration.java
+++ b/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryAutoConfiguration.java
@@ -29,7 +29,7 @@ import org.springframework.context.annotation.Scope;
 
 @Configuration
 @AutoConfigureBefore(CamelAutoConfiguration.class)
-@ConditionalOnProperty(prefix = "camel.component.zookeeper.service-registry", name = "enabled")
+@ConditionalOnProperty(prefix = "camel.cloud.zookeeper", name = "enabled")
 @EnableConfigurationProperties(ZooKeeperServiceRegistryConfiguration.class)
 public class ZooKeeperServiceRegistryAutoConfiguration {
 
diff --git a/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryConfiguration.java b/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryConfiguration.java
index 941a4cb..2f315bd 100644
--- a/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryConfiguration.java
+++ b/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryConfiguration.java
@@ -25,7 +25,7 @@ import org.apache.curator.framework.AuthInfo;
 import org.apache.curator.framework.CuratorFramework;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
-@ConfigurationProperties(prefix = "camel.component.zookeeper.service-registry")
+@ConfigurationProperties(prefix = "camel.cloud.zookeeper")
 public class ZooKeeperServiceRegistryConfiguration extends org.apache.camel.component.zookeeper.cloud.ZooKeeperServiceRegistryConfiguration {
     /**
      * Sets if the zookeeper service registry should be enabled or not, default is false.
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-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceAutoConfiguration.java
index d55e769..adc600a 100644
--- a/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceAutoConfiguration.java
+++ b/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceAutoConfiguration.java
@@ -32,7 +32,7 @@ import org.springframework.context.annotation.Scope;
 
 @Configuration
 @AutoConfigureBefore({ ClusteredRouteControllerAutoConfiguration.class, CamelAutoConfiguration.class })
-@ConditionalOnProperty(prefix = "camel.component.zookeeper.cluster.service", name = "enabled")
+@ConditionalOnProperty(prefix = "camel.cluster.zookeeper", name = "enabled")
 @EnableConfigurationProperties(ZooKeeperClusterServiceConfiguration.class)
 public class ZooKeeperClusterServiceAutoConfiguration {
     @Autowired
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-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceConfiguration.java
index cf78b03..53dc7a6 100644
--- a/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceConfiguration.java
+++ b/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceConfiguration.java
@@ -26,7 +26,7 @@ import org.apache.curator.framework.AuthInfo;
 import org.apache.curator.framework.CuratorFramework;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
-@ConfigurationProperties(prefix = "camel.component.zookeeper.cluster.service")
+@ConfigurationProperties(prefix = "camel.cluster.zookeeper")
 public class ZooKeeperClusterServiceConfiguration extends ZooKeeperCuratorConfiguration {
     /**
      * Sets if the zookeeper cluster service should be enabled or not, default is false.
diff --git a/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryTest.java b/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryTest.java
index 77be8eb..b5a503b 100644
--- a/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryTest.java
+++ b/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cloud/ZooKeeperServiceRegistryTest.java
@@ -79,11 +79,11 @@ public class ZooKeeperServiceRegistryTest {
                     "debug=false",
                     "spring.main.banner-mode=OFF",
                     "spring.application.name=" + UUID.randomUUID().toString(),
-                    "camel.component.zookeeper.service-registry.enabled=true",
-                    "camel.component.zookeeper.service-registry.nodes=localhost:" + zkPort,
-                    "camel.component.zookeeper.service-registry.id=" + UUID.randomUUID().toString(),
-                    "camel.component.zookeeper.service-registry.base-path=" + SERVICE_PATH,
-                    "camel.component.zookeeper.service-registry.service-host=localhost")
+                    "camel.cloud.zookeeper.enabled=true",
+                    "camel.cloud.zookeeper.nodes=localhost:" + zkPort,
+                    "camel.cloud.zookeeper.id=" + UUID.randomUUID().toString(),
+                    "camel.cloud.zookeeper.base-path=" + SERVICE_PATH,
+                    "camel.cloud.zookeeper.service-host=localhost")
                 .run(
                     context -> {
                         assertThat(context).hasSingleBean(CamelContext.class);
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-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceTest.java
index 5cfc67a..f9cefac 100644
--- a/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceTest.java
+++ b/components-starter/camel-zookeeper-starter/src/test/java/org/apache/camel/component/zookeeper/springboot/cluster/ZooKeeperClusterServiceTest.java
@@ -56,11 +56,11 @@ public class ZooKeeperClusterServiceTest {
                 .withPropertyValues(
                     "debug=false",
                     "spring.main.banner-mode=OFF",
-                    "spring.application.name=" + UUID.randomUUID().toString(),
-                    "camel.component.zookeeper.cluster.service.enabled=true",
-                    "camel.component.zookeeper.cluster.service.nodes=localhost:" + zkPort,
-                    "camel.component.zookeeper.cluster.service.id=" + UUID.randomUUID().toString(),
-                    "camel.component.zookeeper.cluster.service.base-path=" + SERVICE_PATH)
+                    "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)
                 .run(
                     context -> {
                         assertThat(context).hasSingleBean(CamelContext.class);