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/26 07:58:03 UTC

[camel-spring-boot] branch main updated (a16b32b -> 3718217)

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

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


    from a16b32b  Regen
     new 8c7af59  camel-cloud - Added recently exchange as parameter
     new 09f23b1  Regen
     new 3718217  Dump routes option

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/camel/springboot/catalog/components/cql.json   |  4 ++--
 core/camel-spring-boot/src/main/docs/spring-boot.adoc         |  3 ++-
 .../camel/spring/boot/CamelConfigurationProperties.java       | 11 +++++++++++
 .../camel/spring/boot/cloud/CamelCloudServiceFilter.java      |  5 +++--
 .../spring/cloud/netflix/CamelCloudNetflixServerList.java     |  6 +++---
 .../cloud/netflix/CamelCloudNetflixServiceLoadBalancer.java   |  3 ++-
 .../spring/cloud/CamelSpringCloudServiceLoadBalancer.java     |  5 +++--
 .../apache/camel/spring/cloud/DefaultServiceLoadBalancer.java |  9 ++++-----
 docs/modules/ROOT/pages/spring-boot.adoc                      |  3 ++-
 9 files changed, 32 insertions(+), 17 deletions(-)

[camel-spring-boot] 01/03: camel-cloud - Added recently exchange as parameter

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8c7af593f21c19c460b75982fa91b549c6bbf7dd
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Apr 26 09:47:15 2021 +0200

    camel-cloud - Added recently exchange as parameter
---
 .../apache/camel/spring/boot/cloud/CamelCloudServiceFilter.java  | 5 +++--
 .../camel/spring/cloud/netflix/CamelCloudNetflixServerList.java  | 6 +++---
 .../cloud/netflix/CamelCloudNetflixServiceLoadBalancer.java      | 3 ++-
 .../camel/spring/cloud/CamelSpringCloudServiceLoadBalancer.java  | 5 +++--
 .../apache/camel/spring/cloud/DefaultServiceLoadBalancer.java    | 9 ++++-----
 5 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/cloud/CamelCloudServiceFilter.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/cloud/CamelCloudServiceFilter.java
index da4e0c8..e517ba2 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/cloud/CamelCloudServiceFilter.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/cloud/CamelCloudServiceFilter.java
@@ -18,6 +18,7 @@ package org.apache.camel.spring.boot.cloud;
 
 import java.util.List;
 
+import org.apache.camel.Exchange;
 import org.apache.camel.cloud.ServiceDefinition;
 import org.apache.camel.cloud.ServiceFilter;
 import org.apache.camel.impl.cloud.CombinedServiceFilter;
@@ -30,7 +31,7 @@ public class CamelCloudServiceFilter implements ServiceFilter {
     }
 
     @Override
-    public List<ServiceDefinition> apply(List<ServiceDefinition> serviceDefinitionList) {
-        return  this.serviceFilter.apply(serviceDefinitionList);
+    public List<ServiceDefinition> apply(Exchange exchange, List<ServiceDefinition> services) {
+        return this.serviceFilter.apply(exchange, services);
     }
 }
diff --git a/core/camel-spring-cloud-netflix/src/main/java/org/apache/camel/spring/cloud/netflix/CamelCloudNetflixServerList.java b/core/camel-spring-cloud-netflix/src/main/java/org/apache/camel/spring/cloud/netflix/CamelCloudNetflixServerList.java
index 5aeb106..cd9fd6e 100644
--- a/core/camel-spring-cloud-netflix/src/main/java/org/apache/camel/spring/cloud/netflix/CamelCloudNetflixServerList.java
+++ b/core/camel-spring-cloud-netflix/src/main/java/org/apache/camel/spring/cloud/netflix/CamelCloudNetflixServerList.java
@@ -33,7 +33,7 @@ public class CamelCloudNetflixServerList extends AbstractServerList<RibbonServic
     private String serviceId;
 
     public CamelCloudNetflixServerList() {
-        this(null, list -> list);
+        this(null, null);
     }
 
     public CamelCloudNetflixServerList(ServiceDiscovery serviceDiscovery, ServiceFilter serviceFilter) {
@@ -70,7 +70,7 @@ public class CamelCloudNetflixServerList extends AbstractServerList<RibbonServic
 
         List<ServiceDefinition> services = serviceDiscovery.getServices(serviceId);
         if (serviceFilter != null) {
-            services = serviceFilter.apply(services);
+            services = serviceFilter.apply(null, services);
         }
 
         return convert(services);
@@ -84,7 +84,7 @@ public class CamelCloudNetflixServerList extends AbstractServerList<RibbonServic
 
         List<ServiceDefinition> services = serviceDiscovery.getServices(serviceId);
         if (serviceFilter != null) {
-            services = serviceFilter.apply(services);
+            services = serviceFilter.apply(null, services);
         }
 
         return convert(services);
diff --git a/core/camel-spring-cloud-netflix/src/main/java/org/apache/camel/spring/cloud/netflix/CamelCloudNetflixServiceLoadBalancer.java b/core/camel-spring-cloud-netflix/src/main/java/org/apache/camel/spring/cloud/netflix/CamelCloudNetflixServiceLoadBalancer.java
index dd96e6d..5c253f5 100644
--- a/core/camel-spring-cloud-netflix/src/main/java/org/apache/camel/spring/cloud/netflix/CamelCloudNetflixServiceLoadBalancer.java
+++ b/core/camel-spring-cloud-netflix/src/main/java/org/apache/camel/spring/cloud/netflix/CamelCloudNetflixServiceLoadBalancer.java
@@ -19,6 +19,7 @@ package org.apache.camel.spring.cloud.netflix;
 import java.util.List;
 
 import com.netflix.loadbalancer.Server;
+import org.apache.camel.Exchange;
 import org.apache.camel.cloud.ServiceDefinition;
 import org.apache.camel.cloud.ServiceLoadBalancer;
 import org.apache.camel.cloud.ServiceLoadBalancerFunction;
@@ -37,7 +38,7 @@ public class CamelCloudNetflixServiceLoadBalancer implements ServiceLoadBalancer
     }
 
     @Override
-    public <T> T process(String serviceName, ServiceLoadBalancerFunction<T> function) throws Exception {
+    public <T> T process(Exchange exchange, String serviceName, ServiceLoadBalancerFunction<T> function) throws Exception {
         return client.execute(serviceName, instance -> {
             ServiceDefinition definition = null;
 
diff --git a/core/camel-spring-cloud/src/main/java/org/apache/camel/spring/cloud/CamelSpringCloudServiceLoadBalancer.java b/core/camel-spring-cloud/src/main/java/org/apache/camel/spring/cloud/CamelSpringCloudServiceLoadBalancer.java
index 6a1ebbc..dcff8cf 100644
--- a/core/camel-spring-cloud/src/main/java/org/apache/camel/spring/cloud/CamelSpringCloudServiceLoadBalancer.java
+++ b/core/camel-spring-cloud/src/main/java/org/apache/camel/spring/cloud/CamelSpringCloudServiceLoadBalancer.java
@@ -20,6 +20,7 @@ import java.util.Optional;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.CamelContextAware;
+import org.apache.camel.Exchange;
 import org.apache.camel.cloud.ServiceLoadBalancer;
 import org.apache.camel.cloud.ServiceLoadBalancerFunction;
 import org.apache.camel.support.service.ServiceSupport;
@@ -63,8 +64,8 @@ public class CamelSpringCloudServiceLoadBalancer extends ServiceSupport implemen
     }
 
     @Override
-    public <T> T process(String serviceName, ServiceLoadBalancerFunction<T> function) throws Exception {
-        return loadBalancer.process(serviceName, function);
+    public <T> T process(Exchange exchange, String serviceName, ServiceLoadBalancerFunction<T> function) throws Exception {
+        return loadBalancer.process(exchange, serviceName, function);
     }
 
     // *******************************
diff --git a/core/camel-spring-cloud/src/main/java/org/apache/camel/spring/cloud/DefaultServiceLoadBalancer.java b/core/camel-spring-cloud/src/main/java/org/apache/camel/spring/cloud/DefaultServiceLoadBalancer.java
index ffbcef9..6d5c763 100644
--- a/core/camel-spring-cloud/src/main/java/org/apache/camel/spring/cloud/DefaultServiceLoadBalancer.java
+++ b/core/camel-spring-cloud/src/main/java/org/apache/camel/spring/cloud/DefaultServiceLoadBalancer.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.spring.cloud;
 
+import org.apache.camel.Exchange;
 import org.apache.camel.cloud.ServiceDefinition;
 import org.apache.camel.cloud.ServiceLoadBalancer;
 import org.apache.camel.cloud.ServiceLoadBalancerFunction;
@@ -31,12 +32,10 @@ public class DefaultServiceLoadBalancer implements ServiceLoadBalancer {
     }
 
     @Override
-    public <T> T process(String serviceName, ServiceLoadBalancerFunction<T> function) throws Exception {
-        return client.execute(serviceName, instance -> {
-            return function.apply(
+    public <T> T process(Exchange exchange, String serviceName, ServiceLoadBalancerFunction<T> function) throws Exception {
+        return client.execute(serviceName, instance -> function.apply(
                 convertServiceInstanceToServiceDefinition(instance)
-            );
-        });
+        ));
     }
 
     protected ServiceDefinition convertServiceInstanceToServiceDefinition(ServiceInstance instance) {

[camel-spring-boot] 03/03: Dump routes option

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 37182173a786ca2b830a80c6a216fe751e4e2564
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Apr 26 09:57:47 2021 +0200

    Dump routes option
---
 core/camel-spring-boot/src/main/docs/spring-boot.adoc         |  3 ++-
 .../camel/spring/boot/CamelConfigurationProperties.java       | 11 +++++++++++
 docs/modules/ROOT/pages/spring-boot.adoc                      |  3 ++-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/core/camel-spring-boot/src/main/docs/spring-boot.adoc b/core/camel-spring-boot/src/main/docs/spring-boot.adoc
index 73a16e2..ca9ee60 100644
--- a/core/camel-spring-boot/src/main/docs/spring-boot.adoc
+++ b/core/camel-spring-boot/src/main/docs/spring-boot.adoc
@@ -92,7 +92,7 @@ When using spring-boot with Spring Boot make sure to use the following Maven dep
 ----
 
 
-The component supports 171 options, which are listed below.
+The component supports 172 options, which are listed below.
 
 
 
@@ -157,6 +157,7 @@ The component supports 171 options, which are listed below.
 | *camel.springboot.bean-post-processor-enabled* | Can be used to turn off bean post processing. Be careful to turn this off, as this means that beans that use Camel annotations such as org.apache.camel.EndpointInject, org.apache.camel.ProducerTemplate, org.apache.camel.Produce, org.apache.camel.Consume etc will not be injected and in use. Turning this off should only be done if you are sure you do not use any of these Camel features. Not all runtimes allow turning this off (such as came [...]
 | *camel.springboot.case-insensitive-headers* | Whether to use case sensitive or insensitive headers. Important: When using case sensitive (this is set to false). Then the map is case sensitive which means headers such as content-type and Content-Type are two different keys which can be a problem for some protocols such as HTTP based, which rely on case insensitive headers. However case sensitive implementations can yield faster performance. Therefore use case sensitive implementation wi [...]
 | *camel.springboot.consumer-template-cache-size* | Consumer template endpoints cache size. | 1000 | Integer
+| *camel.springboot.dump-routes* | If dumping is enabled then Camel will during startup dump all loaded routes (incl rests and route templates) represented as XML DSL into the log. This is intended for trouble shooting or to assist during development. Sensitive information that may be configured in the route endpoints could potentially be included in the dump output and is therefore not recommended to be used for production usage. This requires to have camel-xml-jaxb on the classpath to  [...]
 | *camel.springboot.duration-max-idle-seconds* | To specify for how long time in seconds Camel can be idle before automatic terminating the JVM. You can use this to run Spring Boot for a short while. | 0 | Integer
 | *camel.springboot.duration-max-messages* | To specify how many messages to process by Camel before automatic terminating the JVM. You can use this to run Spring Boot for a short while. | 0 | Integer
 | *camel.springboot.duration-max-seconds* | To specify for how long time in seconds to keep running the JVM before automatic terminating the JVM. You can use this to run Spring Boot for a short while. | 0 | Integer
diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
index ed7a580..0f19fd6 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
@@ -454,6 +454,17 @@ public class CamelConfigurationProperties extends DefaultConfigurationProperties
     private String jmxManagementNamePattern = "#name#";
 
     /**
+     * If dumping is enabled then Camel will during startup dump all loaded routes (incl rests and route templates)
+     * represented as XML DSL into the log. This is intended for trouble shooting or to assist during development.
+     *
+     * Sensitive information that may be configured in the route endpoints could potentially be included in the dump
+     * output and is therefore not recommended to be used for production usage.
+     *
+     * This requires to have camel-xml-jaxb on the classpath to be able to dump the routes as XML.
+     */
+    private boolean dumpRoutes;
+
+    /**
      * To turn on MDC logging
      */
     private boolean useMdcLogging;
diff --git a/docs/modules/ROOT/pages/spring-boot.adoc b/docs/modules/ROOT/pages/spring-boot.adoc
index 73a16e2..ca9ee60 100644
--- a/docs/modules/ROOT/pages/spring-boot.adoc
+++ b/docs/modules/ROOT/pages/spring-boot.adoc
@@ -92,7 +92,7 @@ When using spring-boot with Spring Boot make sure to use the following Maven dep
 ----
 
 
-The component supports 171 options, which are listed below.
+The component supports 172 options, which are listed below.
 
 
 
@@ -157,6 +157,7 @@ The component supports 171 options, which are listed below.
 | *camel.springboot.bean-post-processor-enabled* | Can be used to turn off bean post processing. Be careful to turn this off, as this means that beans that use Camel annotations such as org.apache.camel.EndpointInject, org.apache.camel.ProducerTemplate, org.apache.camel.Produce, org.apache.camel.Consume etc will not be injected and in use. Turning this off should only be done if you are sure you do not use any of these Camel features. Not all runtimes allow turning this off (such as came [...]
 | *camel.springboot.case-insensitive-headers* | Whether to use case sensitive or insensitive headers. Important: When using case sensitive (this is set to false). Then the map is case sensitive which means headers such as content-type and Content-Type are two different keys which can be a problem for some protocols such as HTTP based, which rely on case insensitive headers. However case sensitive implementations can yield faster performance. Therefore use case sensitive implementation wi [...]
 | *camel.springboot.consumer-template-cache-size* | Consumer template endpoints cache size. | 1000 | Integer
+| *camel.springboot.dump-routes* | If dumping is enabled then Camel will during startup dump all loaded routes (incl rests and route templates) represented as XML DSL into the log. This is intended for trouble shooting or to assist during development. Sensitive information that may be configured in the route endpoints could potentially be included in the dump output and is therefore not recommended to be used for production usage. This requires to have camel-xml-jaxb on the classpath to  [...]
 | *camel.springboot.duration-max-idle-seconds* | To specify for how long time in seconds Camel can be idle before automatic terminating the JVM. You can use this to run Spring Boot for a short while. | 0 | Integer
 | *camel.springboot.duration-max-messages* | To specify how many messages to process by Camel before automatic terminating the JVM. You can use this to run Spring Boot for a short while. | 0 | Integer
 | *camel.springboot.duration-max-seconds* | To specify for how long time in seconds to keep running the JVM before automatic terminating the JVM. You can use this to run Spring Boot for a short while. | 0 | Integer

[camel-spring-boot] 02/03: Regen

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 09f23b18aac94a6f83765a868bc6c20fc0d2a57f
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Apr 26 09:57:39 2021 +0200

    Regen
---
 .../resources/org/apache/camel/springboot/catalog/components/cql.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/cql.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/cql.json
index d526b78..78ad67a 100644
--- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/cql.json
+++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/cql.json
@@ -28,8 +28,8 @@
   },
   "properties": {
     "beanRef": { "kind": "path", "displayName": "Bean Ref", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "beanRef is defined using bean:id" },
-    "hosts": { "kind": "path", "displayName": "Hosts", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Hostname(s) cassansdra server(s). Multiple hosts can be separated by comma." },
-    "port": { "kind": "path", "displayName": "Port", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Port number of cassansdra server(s)" },
+    "hosts": { "kind": "path", "displayName": "Hosts", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Hostname(s) Cassandra server(s). Multiple hosts can be separated by comma." },
+    "port": { "kind": "path", "displayName": "Port", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "description": "Port number of Cassandra server(s)" },
     "keyspace": { "kind": "path", "displayName": "Keyspace", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Keyspace to use" },
     "clusterName": { "kind": "parameter", "displayName": "Cluster Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Cluster name" },
     "consistencyLevel": { "kind": "parameter", "displayName": "Consistency Level", "group": "common", "label": "", "required": false, "type": "object", "javaType": "com.datastax.oss.driver.api.core.DefaultConsistencyLevel", "enum": [ "ANY", "ONE", "TWO", "THREE", "QUORUM", "ALL", "LOCAL_ONE", "LOCAL_QUORUM", "EACH_QUORUM", "SERIAL", "LOCAL_SERIAL" ], "deprecated": false, "autowired": false, "secret": false, "description": "Consistency level to use" },