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 2020/09/27 09:12:33 UTC

[camel] branch master updated (fc84b92 -> ac92021)

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

davsclaus pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from fc84b92  CAMEL-15580: SJMS Batch Consumer startup race condition (#4306)
     new d06f03e  CAMEL-14499: Optimize to avoid using camel-core-catalog for SendDynamicAware for camel-file/camel-ftp.
     new 3f6e103  CAMEL-14499: Component verifiers require camel-core-catalog at runtime - added for testing.
     new 549c029  CAMEL-14499: Update 3.6 upgrade guide
     new 9ff0363  CAMEL-14499: Optimize to avoid using camel-core-catalog for SendDynamicAware for camel-file/camel-ftp.
     new ac92021  Add test based on user forum issue

The 5 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:
 components/camel-aws-cw/pom.xml                    |   5 +
 components/camel-aws-ddb/pom.xml                   |   5 +
 components/camel-aws-ec2/pom.xml                   |   5 +
 components/camel-aws-ecs/pom.xml                   |   5 +
 components/camel-aws-eks/pom.xml                   |   5 +
 components/camel-aws-iam/pom.xml                   |   5 +
 components/camel-aws-kinesis/pom.xml               |   5 +
 components/camel-aws-kms/pom.xml                   |   5 +
 components/camel-aws-lambda/pom.xml                |   5 +
 components/camel-aws-mq/pom.xml                    |   5 +
 components/camel-aws-msk/pom.xml                   |   5 +
 components/camel-aws-s3/pom.xml                    |   5 +
 components/camel-aws-ses/pom.xml                   |   5 +
 components/camel-aws-sns/pom.xml                   |   5 +
 components/camel-aws-sqs/pom.xml                   |   5 +
 components/camel-aws-swf/pom.xml                   |   5 +
 components/camel-aws2-athena/pom.xml               |   5 +
 components/camel-aws2-cw/pom.xml                   |   5 +
 components/camel-aws2-ddb/pom.xml                  |   5 +
 components/camel-aws2-ec2/pom.xml                  |   5 +
 components/camel-aws2-ecs/pom.xml                  |   5 +
 components/camel-aws2-eks/pom.xml                  |   5 +
 components/camel-aws2-iam/pom.xml                  |   5 +
 components/camel-aws2-kinesis/pom.xml              |   5 +
 components/camel-aws2-kms/pom.xml                  |   5 +
 components/camel-aws2-lambda/pom.xml               |   5 +
 components/camel-aws2-mq/pom.xml                   |   5 +
 components/camel-aws2-msk/pom.xml                  |   5 +
 components/camel-aws2-s3/pom.xml                   |   5 +
 components/camel-aws2-ses/pom.xml                  |   5 +
 components/camel-aws2-sns/pom.xml                  |   5 +
 components/camel-aws2-sqs/pom.xml                  |   5 +
 components/camel-aws2-sts/pom.xml                  |   5 +
 components/camel-dropbox/pom.xml                   |   5 +
 components/camel-elasticsearch-rest/pom.xml        |   5 +
 components/camel-file/pom.xml                      |   5 -
 .../file/GenericFileSendDynamicAware.java          |  19 ++--
 components/camel-google-mail/pom.xml               |   5 +
 .../camel/http/base/HttpSendDynamicAware.java      |  26 +++--
 components/camel-minio/pom.xml                     |   5 +
 components/camel-paho/pom.xml                      |   5 +
 .../camel-salesforce-component/pom.xml             |   5 +
 components/camel-slack/pom.xml                     |   5 +
 components/camel-twitter/pom.xml                   |   5 +
 components/camel-undertow/pom.xml                  |   5 +
 .../org/apache/camel/spi/SendDynamicAware.java     |  33 +++++--
 .../camel/processor/SendDynamicAwareResolver.java  |   1 +
 .../camel/processor/SendDynamicProcessor.java      |   5 +-
 .../camel/component/bar/BarSendDynamicAware.java   |  17 +++-
 .../seda/SedaWireTapOnCompleteTest.java}           |  37 ++++---
 .../support/component/SendDynamicAwareSupport.java | 107 +++++++++++++++++++--
 .../java/org/apache/camel/util/URISupport.java     |  18 ++++
 .../java/org/apache/camel/util/URISupportTest.java |  10 ++
 .../ROOT/pages/camel-3x-upgrade-guide-3_6.adoc     |   9 ++
 54 files changed, 424 insertions(+), 73 deletions(-)
 copy core/camel-core/src/test/java/org/apache/camel/{processor/ThreadsCoreAndMaxPoolTest.java => component/seda/SedaWireTapOnCompleteTest.java} (61%)


[camel] 01/05: CAMEL-14499: Optimize to avoid using camel-core-catalog for SendDynamicAware for camel-file/camel-ftp.

Posted by da...@apache.org.
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.git

commit d06f03e74f013a812ba7e5bf10793e33e711baff
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Sep 26 21:48:42 2020 +0200

    CAMEL-14499: Optimize to avoid using camel-core-catalog for SendDynamicAware for camel-file/camel-ftp.
---
 components/camel-file/pom.xml                      |   5 -
 .../file/GenericFileSendDynamicAware.java          |  18 ++--
 .../camel/http/base/HttpSendDynamicAware.java      |  26 +++--
 .../org/apache/camel/spi/SendDynamicAware.java     |  33 +++++--
 .../camel/processor/SendDynamicAwareResolver.java  |   1 +
 .../camel/processor/SendDynamicProcessor.java      |   5 +-
 .../camel/component/bar/BarSendDynamicAware.java   |  17 +++-
 .../support/component/SendDynamicAwareSupport.java | 105 +++++++++++++++++++--
 8 files changed, 158 insertions(+), 52 deletions(-)

diff --git a/components/camel-file/pom.xml b/components/camel-file/pom.xml
index 138ea49..b1f73d3 100644
--- a/components/camel-file/pom.xml
+++ b/components/camel-file/pom.xml
@@ -43,11 +43,6 @@
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-cluster</artifactId>
         </dependency>
-        <!-- needed for dynamic to -->
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-core-catalog</artifactId>
-        </dependency>
 
     </dependencies>
 </project>
diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileSendDynamicAware.java b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileSendDynamicAware.java
index 0c04241..71566b9 100644
--- a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileSendDynamicAware.java
+++ b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileSendDynamicAware.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.file;
 
-import java.util.LinkedHashMap;
 import java.util.Map;
 
 import org.apache.camel.Exchange;
@@ -26,21 +25,19 @@ import org.apache.camel.util.URISupport;
 
 public abstract class GenericFileSendDynamicAware extends SendDynamicAwareSupport {
 
-    private String scheme;
-
     @Override
-    public void setScheme(String scheme) {
-        this.scheme = scheme;
+    public boolean isOnlyDynamicQueryParameters() {
+        return true;
     }
 
     @Override
-    public String getScheme() {
-        return scheme;
+    public boolean isLenientProperties() {
+        return false;
     }
 
     @Override
     public DynamicAwareEntry prepare(Exchange exchange, String uri, String originalUri) throws Exception {
-        Map<String, String> properties = endpointProperties(exchange, uri);
+        Map<String, Object> properties = endpointProperties(exchange, uri);
         return new DynamicAwareEntry(uri, originalUri, properties, null);
     }
 
@@ -56,8 +53,9 @@ public abstract class GenericFileSendDynamicAware extends SendDynamicAwareSuppor
         // if any of the above are in use, then they should not be pre evaluated
         // and we need to rebuild a new uri with them as-is
         if (fileName || tempFileName || idempotentKey || move || moveFailed || preMove || moveExisting) {
-            Map<String, String> params = new LinkedHashMap<>(entry.getProperties());
+            Map<String, Object> params = entry.getProperties();
 
+            // TODO: parseQuery should only have the query part, this is not correct
             Map<String, Object> originalParams = URISupport.parseQuery(entry.getOriginalUri());
             if (fileName) {
                 Object val = originalParams.get("fileName");
@@ -102,7 +100,7 @@ public abstract class GenericFileSendDynamicAware extends SendDynamicAwareSuppor
                 }
             }
 
-            return asEndpointUri(exchange, scheme, params);
+            return asEndpointUri(exchange, entry.getUri(), params);
         } else {
             return entry.getUri();
         }
diff --git a/components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpSendDynamicAware.java b/components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpSendDynamicAware.java
index 9892acb..5692ec5 100644
--- a/components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpSendDynamicAware.java
+++ b/components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpSendDynamicAware.java
@@ -38,22 +38,20 @@ public class HttpSendDynamicAware extends SendDynamicAwareSupport {
 
     private final Processor postProcessor = new HttpSendDynamicPostProcessor();
 
-    private String scheme;
-
     @Override
-    public void setScheme(String scheme) {
-        this.scheme = scheme;
+    public boolean isOnlyDynamicQueryParameters() {
+        return false;
     }
 
     @Override
-    public String getScheme() {
-        return scheme;
+    public boolean isLenientProperties() {
+        return true;
     }
 
     @Override
     public DynamicAwareEntry prepare(Exchange exchange, String uri, String originalUri) throws Exception {
-        Map<String, String> properties = endpointProperties(exchange, uri);
-        Map<String, String> lenient = endpointLenientProperties(exchange, uri);
+        Map<String, Object> properties = endpointProperties(exchange, uri);
+        Map<String, Object> lenient = endpointLenientProperties(exchange, uri);
         return new DynamicAwareEntry(uri, originalUri, properties, lenient);
     }
 
@@ -65,7 +63,7 @@ public class HttpSendDynamicAware extends SendDynamicAwareSupport {
         if (path != null || !entry.getLenientProperties().isEmpty()) {
             // the context path can be dynamic or any lenient properties
             // and therefore build a new static uri without path or lenient options
-            Map<String, String> params = new LinkedHashMap<>(entry.getProperties());
+            Map<String, Object> params = entry.getProperties();
             for (String k : entry.getLenientProperties().keySet()) {
                 params.remove(k);
             }
@@ -75,12 +73,12 @@ public class HttpSendDynamicAware extends SendDynamicAwareSupport {
                     params.put("httpUri", host);
                 } else if (params.containsKey("httpURI")) {
                     params.put("httpURI", host);
-                } else if ("netty-http".equals(scheme)) {
+                } else if ("netty-http".equals(getScheme())) {
                     // the netty-http stores host,port etc in other fields than httpURI so we can just remove the path parameter
                     params.remove("path");
                 }
             }
-            return asEndpointUri(exchange, scheme, params);
+            return asEndpointUri(exchange, entry.getUri(), params);
         } else {
             // no need for optimisation
             return null;
@@ -118,10 +116,10 @@ public class HttpSendDynamicAware extends SendDynamicAwareSupport {
         String u = entry.getUri();
 
         // remove scheme prefix (unless its camel-http or camel-http)
-        boolean httpComponent = "http".equals(scheme) || "https".equals(scheme);
+        boolean httpComponent = "http".equals(getScheme()) || "https".equals(getScheme());
         if (!httpComponent) {
-            String prefix = scheme + "://";
-            String prefix2 = scheme + ":";
+            String prefix = getScheme() + "://";
+            String prefix2 = getScheme() + ":";
             if (u.startsWith(prefix)) {
                 u = u.substring(prefix.length());
             } else if (u.startsWith(prefix2)) {
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/SendDynamicAware.java b/core/camel-api/src/main/java/org/apache/camel/spi/SendDynamicAware.java
index 2efb5f0..c07ec4a 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/SendDynamicAware.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/SendDynamicAware.java
@@ -18,16 +18,19 @@ package org.apache.camel.spi;
 
 import java.util.Map;
 
+import org.apache.camel.CamelContextAware;
+import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
+import org.apache.camel.Service;
 
 /**
  * Used for components that can optimise the usage of {@link org.apache.camel.processor.SendDynamicProcessor} (toD) to
  * reuse a static {@link org.apache.camel.Endpoint} and {@link Producer} that supports using headers to provide the
  * dynamic parts. For example many of the HTTP components supports this.
  */
-public interface SendDynamicAware {
+public interface SendDynamicAware extends Service, CamelContextAware {
 
     /**
      * Sets the component name.
@@ -42,6 +45,22 @@ public interface SendDynamicAware {
     String getScheme();
 
     /**
+     * Whether only the query parameters can be dynamic and the context-path must be static.
+     *
+     * If true then Camel can restructure endpoint uri using a simple and faster parser.
+     * On the other hand if the context-path and authority part of the URI can be dynamic
+     * then Camel has to use a more complex and slower parser.
+     */
+    boolean isOnlyDynamicQueryParameters();
+
+    /**
+     * Whether the endpoint is lenient or not.
+     *
+     * @see Endpoint#isLenientProperties()
+     */
+    boolean isLenientProperties();
+
+    /**
      * An entry of detailed information from the recipient uri, which allows the {@link SendDynamicAware} implementation
      * to prepare pre- and post- processor and the static uri to be used for the optimised dynamic to.
      */
@@ -49,11 +68,11 @@ public interface SendDynamicAware {
 
         private final String uri;
         private final String originalUri;
-        private final Map<String, String> properties;
-        private final Map<String, String> lenientProperties;
+        private final Map<String, Object> properties;
+        private final Map<String, Object> lenientProperties;
 
-        public DynamicAwareEntry(String uri, String originalUri, Map<String, String> properties,
-                                 Map<String, String> lenientProperties) {
+        public DynamicAwareEntry(String uri, String originalUri, Map<String, Object> properties,
+                                 Map<String, Object> lenientProperties) {
             this.uri = uri;
             this.originalUri = originalUri;
             this.properties = properties;
@@ -68,11 +87,11 @@ public interface SendDynamicAware {
             return originalUri;
         }
 
-        public Map<String, String> getProperties() {
+        public Map<String, Object> getProperties() {
             return properties;
         }
 
-        public Map<String, String> getLenientProperties() {
+        public Map<String, Object> getLenientProperties() {
             return lenientProperties;
         }
     }
diff --git a/core/camel-base/src/main/java/org/apache/camel/processor/SendDynamicAwareResolver.java b/core/camel-base/src/main/java/org/apache/camel/processor/SendDynamicAwareResolver.java
index 6bbefea..8ee8b0c 100644
--- a/core/camel-base/src/main/java/org/apache/camel/processor/SendDynamicAwareResolver.java
+++ b/core/camel-base/src/main/java/org/apache/camel/processor/SendDynamicAwareResolver.java
@@ -51,6 +51,7 @@ public class SendDynamicAwareResolver {
             if (SendDynamicAware.class.isAssignableFrom(type)) {
                 SendDynamicAware answer = (SendDynamicAware) context.getInjector().newInstance(type, false);
                 answer.setScheme(scheme);
+                answer.setCamelContext(context);
                 return answer;
             } else {
                 throw new IllegalArgumentException("Type is not a SendDynamicAware implementation. Found: " + type.getName());
diff --git a/core/camel-base/src/main/java/org/apache/camel/processor/SendDynamicProcessor.java b/core/camel-base/src/main/java/org/apache/camel/processor/SendDynamicProcessor.java
index 118aee1..2ce3ede 100644
--- a/core/camel-base/src/main/java/org/apache/camel/processor/SendDynamicProcessor.java
+++ b/core/camel-base/src/main/java/org/apache/camel/processor/SendDynamicProcessor.java
@@ -336,6 +336,7 @@ public class SendDynamicProcessor extends AsyncProcessorSupport implements IdAwa
                 }
             }
         }
+        ServiceHelper.initService(dynamicAware);
     }
 
     @Override
@@ -355,12 +356,12 @@ public class SendDynamicProcessor extends AsyncProcessorSupport implements IdAwa
             }
         }
 
-        ServiceHelper.startService(producerCache);
+        ServiceHelper.startService(dynamicAware, producerCache);
     }
 
     @Override
     protected void doStop() throws Exception {
-        ServiceHelper.stopService(producerCache);
+        ServiceHelper.stopService(producerCache, dynamicAware);
     }
 
     public EndpointUtilizationStatistics getEndpointUtilizationStatistics() {
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/bar/BarSendDynamicAware.java b/core/camel-core/src/test/java/org/apache/camel/component/bar/BarSendDynamicAware.java
index 2b81589..a044830 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/bar/BarSendDynamicAware.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/bar/BarSendDynamicAware.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.bar;
 
-import java.util.LinkedHashMap;
 import java.util.Map;
 
 import org.apache.camel.Exchange;
@@ -24,11 +23,11 @@ import org.apache.camel.Processor;
 import org.apache.camel.builder.ExpressionBuilder;
 import org.apache.camel.processor.RemoveHeaderProcessor;
 import org.apache.camel.processor.SetHeaderProcessor;
-import org.apache.camel.spi.SendDynamicAware;
+import org.apache.camel.support.component.SendDynamicAwareSupport;
 import org.apache.camel.util.StringHelper;
 import org.apache.camel.util.URISupport;
 
-public class BarSendDynamicAware implements SendDynamicAware {
+public class BarSendDynamicAware extends SendDynamicAwareSupport {
 
     private String scheme;
 
@@ -43,10 +42,20 @@ public class BarSendDynamicAware implements SendDynamicAware {
     }
 
     @Override
+    public boolean isOnlyDynamicQueryParameters() {
+        return false;
+    }
+
+    @Override
+    public boolean isLenientProperties() {
+        return false;
+    }
+
+    @Override
     public DynamicAwareEntry prepare(Exchange exchange, String uri, String originalUri) throws Exception {
         String query = StringHelper.after(uri, "?");
         if (query != null) {
-            Map<String, String> map = new LinkedHashMap(URISupport.parseQuery(query));
+            Map<String, Object> map = URISupport.parseQuery(query);
             return new DynamicAwareEntry(uri, originalUri, map, null);
         } else {
             return new DynamicAwareEntry(uri, originalUri, null, null);
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/component/SendDynamicAwareSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/component/SendDynamicAwareSupport.java
index 12262db..485e7a4 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/component/SendDynamicAwareSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/component/SendDynamicAwareSupport.java
@@ -16,32 +16,117 @@
  */
 package org.apache.camel.support.component;
 
+import java.util.Collections;
+import java.util.LinkedHashMap;
 import java.util.Map;
+import java.util.Set;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.catalog.RuntimeCamelCatalog;
 import org.apache.camel.spi.SendDynamicAware;
+import org.apache.camel.support.service.ServiceSupport;
+import org.apache.camel.util.URISupport;
 
 /**
  * Support class for {@link SendDynamicAware} implementations.
  */
-public abstract class SendDynamicAwareSupport implements SendDynamicAware {
+public abstract class SendDynamicAwareSupport extends ServiceSupport implements SendDynamicAware {
 
-    public Map<String, String> endpointProperties(Exchange exchange, String uri) throws Exception {
-        RuntimeCamelCatalog catalog = exchange.getContext().adapt(ExtendedCamelContext.class).getRuntimeCamelCatalog();
-        Map<String, String> properties = catalog.endpointProperties(uri);
+    private CamelContext camelContext;
+    private Set<String> knownProperties;
+    private String scheme;
+
+    @Override
+    public CamelContext getCamelContext() {
+        return camelContext;
+    }
+
+    @Override
+    public void setCamelContext(CamelContext camelContext) {
+        this.camelContext = camelContext;
+    }
+
+    @Override
+    public void setScheme(String scheme) {
+        this.scheme = scheme;
+    }
+
+    @Override
+    public String getScheme() {
+        return scheme;
+    }
+
+    @Override
+    protected void doInit() throws Exception {
+        if (isOnlyDynamicQueryParameters()) {
+            knownProperties = getCamelContext().adapt(ExtendedCamelContext.class).getEndpointUriFactory(getScheme()).propertyNames();
+        }
+    }
+
+    public Map<String, Object> endpointProperties(Exchange exchange, String uri) throws Exception {
+        Map<String, Object> properties;
+        if (isOnlyDynamicQueryParameters()) {
+            // optimize as we know its only query parameters that can be dynamic, and that there are no lenient properties
+            Map<String, Object> map;
+            int pos = uri.indexOf('?');
+            if (pos != -1) {
+                String query = uri.substring(pos + 1);
+                map = URISupport.parseQuery(query);
+            } else {
+                map = Collections.EMPTY_MAP;
+            }
+            if (map != null && isLenientProperties()) {
+                properties = new LinkedHashMap<>(map.size());
+                // okay so only add the known properties as they are the non lenient properties
+                map.forEach((k, v) -> {
+                    if (knownProperties.contains(k)) {
+                        properties.put(k, v);
+                    }
+                });
+            } else {
+                properties = map;
+            }
+        } else {
+            RuntimeCamelCatalog catalog = exchange.getContext().adapt(ExtendedCamelContext.class).getRuntimeCamelCatalog();
+            properties = new LinkedHashMap<>(catalog.endpointProperties(uri));
+        }
         return properties;
     }
 
-    public Map<String, String> endpointLenientProperties(Exchange exchange, String uri) throws Exception {
-        RuntimeCamelCatalog catalog = exchange.getContext().adapt(ExtendedCamelContext.class).getRuntimeCamelCatalog();
-        Map<String, String> properties = catalog.endpointLenientProperties(uri);
+    public Map<String, Object> endpointLenientProperties(Exchange exchange, String uri) throws Exception {
+        Map<String, Object> properties;
+        if (isOnlyDynamicQueryParameters()) {
+            // optimize as we know its only query parameters that can be dynamic
+            Map<String, Object> map  = URISupport.parseQuery(uri);
+            properties = new LinkedHashMap<>();
+            map.forEach((k, v) -> {
+                if (!knownProperties.contains(k)) {
+                    properties.put(k, v.toString());
+                }
+            });
+        } else {
+            RuntimeCamelCatalog catalog = exchange.getContext().adapt(ExtendedCamelContext.class).getRuntimeCamelCatalog();
+            properties = new LinkedHashMap<>(catalog.endpointLenientProperties(uri));
+        }
         return properties;
     }
 
-    public String asEndpointUri(Exchange exchange, String scheme, Map<String, String> properties) throws Exception {
-        RuntimeCamelCatalog catalog = exchange.getContext().adapt(ExtendedCamelContext.class).getRuntimeCamelCatalog();
-        return catalog.asEndpointUri(scheme, properties, false);
+    public String asEndpointUri(Exchange exchange, String uri, Map<String, Object> properties) throws Exception {
+        if (isOnlyDynamicQueryParameters()) {
+            String answer;
+            String query = URISupport.createQueryString(properties, false);
+            int pos = uri.indexOf('?');
+            if (pos != -1) {
+                answer = uri.substring(0, pos) + "?" + query;
+            } else {
+                answer = uri + "?" + query;
+            }
+            return answer;
+        } else {
+            RuntimeCamelCatalog catalog = exchange.getContext().adapt(ExtendedCamelContext.class).getRuntimeCamelCatalog();
+            return catalog.asEndpointUri(getScheme(), new LinkedHashMap(properties), false);
+        }
     }
 }


[camel] 05/05: Add test based on user forum issue

Posted by da...@apache.org.
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.git

commit ac92021b9a68c7d9c76d3eefb33a3ae350376b07
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Sep 27 11:12:01 2020 +0200

    Add test based on user forum issue
---
 .../component/seda/SedaWireTapOnCompleteTest.java  | 56 ++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWireTapOnCompleteTest.java b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWireTapOnCompleteTest.java
new file mode 100644
index 0000000..97a9803
--- /dev/null
+++ b/core/camel-core/src/test/java/org/apache/camel/component/seda/SedaWireTapOnCompleteTest.java
@@ -0,0 +1,56 @@
+/*
+ * 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.seda;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.jupiter.api.Test;
+
+public class SedaWireTapOnCompleteTest extends ContextTestSupport {
+
+    @Test
+    public void testSeda() throws Exception {
+        getMockEndpoint("mock:done").expectedHeaderValuesReceivedInAnyOrder("foo", "123", "456");
+        getMockEndpoint("mock:first").expectedHeaderReceived("foo", "123");
+        getMockEndpoint("mock:second").expectedHeaderReceived("foo", "456");
+
+        template.sendBody("direct:start", "Hello World");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                onCompletion().log("Done ${header.foo}").to("mock:done");
+
+                from("direct:start")
+                    .setHeader("foo", constant("123"))
+                    .log("First ${header.foo}")
+                    .wireTap("seda:cheese")
+                    .to("mock:first");
+
+                from("seda:cheese")
+                    .setHeader("foo", constant("456"))
+                    .log("Second ${header.foo}")
+                    .to("mock:second");
+            }
+        };
+    }
+}


[camel] 03/05: CAMEL-14499: Update 3.6 upgrade guide

Posted by da...@apache.org.
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.git

commit 549c0293785d04e7a5b221ef1b480d9e84405f7b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Sep 27 10:36:11 2020 +0200

    CAMEL-14499: Update 3.6 upgrade guide
---
 .../modules/ROOT/pages/camel-3x-upgrade-guide-3_6.adoc           | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_6.adoc b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_6.adoc
index 206f42b..d2daddb 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_6.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_6.adoc
@@ -117,6 +117,15 @@ public class Application {
 As a consequence of this change, the Camel Spring Boot starters have been amended to use Customizers instead of creating instances of components, languages or data formats.
 ====
 
+=== Component Verifiers
+
+Camel components which provides `ComponentVerifierExtension` should have `camel-core-catalog` added as dependency at runtime, if the verifier are in use.
+You will see an exception about `camel-core-catalog` not found on classpath otherwise.
+
+=== SendDynamicAware
+
+The API in `org.apache.camel.spi.SendDynamicAware` has changed and any custom implementations must be updated accordingly.
+There is a new abstract `org.apache.camel.support.component.SendDynamicAwareSupport` class which can be used as base for custom implementations.
 
 === Camel Caffeine
 


[camel] 04/05: CAMEL-14499: Optimize to avoid using camel-core-catalog for SendDynamicAware for camel-file/camel-ftp.

Posted by da...@apache.org.
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.git

commit 9ff036334e80e8df9f65116b04d2da4efe437adf
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Sep 27 11:00:36 2020 +0200

    CAMEL-14499: Optimize to avoid using camel-core-catalog for SendDynamicAware for camel-file/camel-ftp.
---
 .../file/GenericFileSendDynamicAware.java          |  3 +-
 .../support/component/SendDynamicAwareSupport.java | 42 +++++++++++-----------
 .../java/org/apache/camel/util/URISupport.java     | 18 ++++++++++
 .../java/org/apache/camel/util/URISupportTest.java | 10 ++++++
 4 files changed, 51 insertions(+), 22 deletions(-)

diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileSendDynamicAware.java b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileSendDynamicAware.java
index 71566b9..0c5a210 100644
--- a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileSendDynamicAware.java
+++ b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileSendDynamicAware.java
@@ -55,8 +55,7 @@ public abstract class GenericFileSendDynamicAware extends SendDynamicAwareSuppor
         if (fileName || tempFileName || idempotentKey || move || moveFailed || preMove || moveExisting) {
             Map<String, Object> params = entry.getProperties();
 
-            // TODO: parseQuery should only have the query part, this is not correct
-            Map<String, Object> originalParams = URISupport.parseQuery(entry.getOriginalUri());
+            Map<String, Object> originalParams = URISupport.parseQuery(URISupport.extractQuery(entry.getOriginalUri()));
             if (fileName) {
                 Object val = originalParams.get("fileName");
                 if (val != null) {
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/component/SendDynamicAwareSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/component/SendDynamicAwareSupport.java
index 485e7a4..c68b303 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/component/SendDynamicAwareSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/component/SendDynamicAwareSupport.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.support.component;
 
-import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Set;
@@ -25,6 +24,7 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.catalog.RuntimeCamelCatalog;
+import org.apache.camel.spi.EndpointUriFactory;
 import org.apache.camel.spi.SendDynamicAware;
 import org.apache.camel.support.service.ServiceSupport;
 import org.apache.camel.util.URISupport;
@@ -61,25 +61,23 @@ public abstract class SendDynamicAwareSupport extends ServiceSupport implements
     @Override
     protected void doInit() throws Exception {
         if (isOnlyDynamicQueryParameters()) {
-            knownProperties = getCamelContext().adapt(ExtendedCamelContext.class).getEndpointUriFactory(getScheme()).propertyNames();
+            // optimize to eager load the list of known properties
+            EndpointUriFactory factory = getCamelContext().adapt(ExtendedCamelContext.class).getEndpointUriFactory(getScheme());
+            if (factory == null) {
+                throw new IllegalStateException("Cannot find EndpointUriFactory for component: " + getScheme());
+            }
+            knownProperties = factory.propertyNames();
         }
     }
 
     public Map<String, Object> endpointProperties(Exchange exchange, String uri) throws Exception {
         Map<String, Object> properties;
         if (isOnlyDynamicQueryParameters()) {
-            // optimize as we know its only query parameters that can be dynamic, and that there are no lenient properties
-            Map<String, Object> map;
-            int pos = uri.indexOf('?');
-            if (pos != -1) {
-                String query = uri.substring(pos + 1);
-                map = URISupport.parseQuery(query);
-            } else {
-                map = Collections.EMPTY_MAP;
-            }
-            if (map != null && isLenientProperties()) {
-                properties = new LinkedHashMap<>(map.size());
+            // optimize as we know its only query parameters that can be dynamic
+            Map<String, Object> map = URISupport.parseQuery(URISupport.extractQuery(uri));
+            if (map != null && !map.isEmpty() && isLenientProperties()) {
                 // okay so only add the known properties as they are the non lenient properties
+                properties = new LinkedHashMap<>();
                 map.forEach((k, v) -> {
                     if (knownProperties.contains(k)) {
                         properties.put(k, v);
@@ -99,13 +97,17 @@ public abstract class SendDynamicAwareSupport extends ServiceSupport implements
         Map<String, Object> properties;
         if (isOnlyDynamicQueryParameters()) {
             // optimize as we know its only query parameters that can be dynamic
-            Map<String, Object> map  = URISupport.parseQuery(uri);
-            properties = new LinkedHashMap<>();
-            map.forEach((k, v) -> {
-                if (!knownProperties.contains(k)) {
-                    properties.put(k, v.toString());
-                }
-            });
+            Map<String, Object> map = URISupport.parseQuery(URISupport.extractQuery(uri));
+            if (map != null && !map.isEmpty()) {
+                properties = new LinkedHashMap<>();
+                map.forEach((k, v) -> {
+                    if (!knownProperties.contains(k)) {
+                        properties.put(k, v.toString());
+                    }
+                });
+            } else {
+                properties = map;
+            }
         } else {
             RuntimeCamelCatalog catalog = exchange.getContext().adapt(ExtendedCamelContext.class).getRuntimeCamelCatalog();
             properties = new LinkedHashMap<>(catalog.endpointLenientProperties(uri));
diff --git a/core/camel-util/src/main/java/org/apache/camel/util/URISupport.java b/core/camel-util/src/main/java/org/apache/camel/util/URISupport.java
index 179753e..983c0df 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/URISupport.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/URISupport.java
@@ -116,6 +116,24 @@ public final class URISupport {
     }
 
     /**
+     * Extracts the query part of the given uri
+     *
+     * @param uri  the uri
+     * @return the query parameters or <tt>null</tt> if the uri has no query
+     */
+    public static String extractQuery(String uri) {
+        if (uri == null) {
+            return null;
+        }
+        int pos = uri.indexOf('?');
+        if (pos != -1) {
+            return uri.substring(pos + 1);
+        } else {
+            return null;
+        }
+    }
+
+    /**
      * Parses the query part of the uri (eg the parameters).
      * <p/>
      * The URI parameters will by default be URI encoded. However you can define a parameter values with the syntax:
diff --git a/core/camel-util/src/test/java/org/apache/camel/util/URISupportTest.java b/core/camel-util/src/test/java/org/apache/camel/util/URISupportTest.java
index 19d5384..2fd7e46 100644
--- a/core/camel-util/src/test/java/org/apache/camel/util/URISupportTest.java
+++ b/core/camel-util/src/test/java/org/apache/camel/util/URISupportTest.java
@@ -567,4 +567,14 @@ public class URISupportTest {
         assertThat(URISupport.joinPaths("/a/", null, null, null)).isEqualTo("/a/");
         assertThat(URISupport.joinPaths("a/", "/b", null, null)).isEqualTo("a/b");
     }
+
+    @Test
+    public void testExtractQuery() throws Exception {
+        assertEquals(null, URISupport.extractQuery(null));
+        assertEquals(null, URISupport.extractQuery(""));
+        assertEquals(null, URISupport.extractQuery("file:foo"));
+        assertEquals("recursive=true", URISupport.extractQuery("file:foo?recursive=true"));
+        assertEquals("recursive=true&delete=true", URISupport.extractQuery("file:foo?recursive=true&delete=true"));
+    }
+
 }


[camel] 02/05: CAMEL-14499: Component verifiers require camel-core-catalog at runtime - added for testing.

Posted by da...@apache.org.
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.git

commit 3f6e103b8bcf3303350dba7b4153170de837aad1
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Sep 27 10:30:44 2020 +0200

    CAMEL-14499: Component verifiers require camel-core-catalog at runtime - added for testing.
---
 components/camel-aws-cw/pom.xml                                | 5 +++++
 components/camel-aws-ddb/pom.xml                               | 5 +++++
 components/camel-aws-ec2/pom.xml                               | 5 +++++
 components/camel-aws-ecs/pom.xml                               | 5 +++++
 components/camel-aws-eks/pom.xml                               | 5 +++++
 components/camel-aws-iam/pom.xml                               | 5 +++++
 components/camel-aws-kinesis/pom.xml                           | 5 +++++
 components/camel-aws-kms/pom.xml                               | 5 +++++
 components/camel-aws-lambda/pom.xml                            | 5 +++++
 components/camel-aws-mq/pom.xml                                | 5 +++++
 components/camel-aws-msk/pom.xml                               | 5 +++++
 components/camel-aws-s3/pom.xml                                | 5 +++++
 components/camel-aws-ses/pom.xml                               | 5 +++++
 components/camel-aws-sns/pom.xml                               | 5 +++++
 components/camel-aws-sqs/pom.xml                               | 5 +++++
 components/camel-aws-swf/pom.xml                               | 5 +++++
 components/camel-aws2-athena/pom.xml                           | 5 +++++
 components/camel-aws2-cw/pom.xml                               | 5 +++++
 components/camel-aws2-ddb/pom.xml                              | 5 +++++
 components/camel-aws2-ec2/pom.xml                              | 5 +++++
 components/camel-aws2-ecs/pom.xml                              | 5 +++++
 components/camel-aws2-eks/pom.xml                              | 5 +++++
 components/camel-aws2-iam/pom.xml                              | 5 +++++
 components/camel-aws2-kinesis/pom.xml                          | 5 +++++
 components/camel-aws2-kms/pom.xml                              | 5 +++++
 components/camel-aws2-lambda/pom.xml                           | 5 +++++
 components/camel-aws2-mq/pom.xml                               | 5 +++++
 components/camel-aws2-msk/pom.xml                              | 5 +++++
 components/camel-aws2-s3/pom.xml                               | 5 +++++
 components/camel-aws2-ses/pom.xml                              | 5 +++++
 components/camel-aws2-sns/pom.xml                              | 5 +++++
 components/camel-aws2-sqs/pom.xml                              | 5 +++++
 components/camel-aws2-sts/pom.xml                              | 5 +++++
 components/camel-dropbox/pom.xml                               | 5 +++++
 components/camel-elasticsearch-rest/pom.xml                    | 5 +++++
 components/camel-google-mail/pom.xml                           | 5 +++++
 components/camel-minio/pom.xml                                 | 5 +++++
 components/camel-paho/pom.xml                                  | 5 +++++
 components/camel-salesforce/camel-salesforce-component/pom.xml | 5 +++++
 components/camel-slack/pom.xml                                 | 5 +++++
 components/camel-twitter/pom.xml                               | 5 +++++
 components/camel-undertow/pom.xml                              | 5 +++++
 42 files changed, 210 insertions(+)

diff --git a/components/camel-aws-cw/pom.xml b/components/camel-aws-cw/pom.xml
index d76d145..22059cf 100644
--- a/components/camel-aws-cw/pom.xml
+++ b/components/camel-aws-cw/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws-ddb/pom.xml b/components/camel-aws-ddb/pom.xml
index 1588a1f..5f4266d 100644
--- a/components/camel-aws-ddb/pom.xml
+++ b/components/camel-aws-ddb/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws-ec2/pom.xml b/components/camel-aws-ec2/pom.xml
index f364929..5b73ca2 100644
--- a/components/camel-aws-ec2/pom.xml
+++ b/components/camel-aws-ec2/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws-ecs/pom.xml b/components/camel-aws-ecs/pom.xml
index 660eb09..94f88b8 100644
--- a/components/camel-aws-ecs/pom.xml
+++ b/components/camel-aws-ecs/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws-eks/pom.xml b/components/camel-aws-eks/pom.xml
index b5164d7..297038c 100644
--- a/components/camel-aws-eks/pom.xml
+++ b/components/camel-aws-eks/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws-iam/pom.xml b/components/camel-aws-iam/pom.xml
index cdb9769..47e0a00 100644
--- a/components/camel-aws-iam/pom.xml
+++ b/components/camel-aws-iam/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws-kinesis/pom.xml b/components/camel-aws-kinesis/pom.xml
index 1698efa..f43fa79 100644
--- a/components/camel-aws-kinesis/pom.xml
+++ b/components/camel-aws-kinesis/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws-kms/pom.xml b/components/camel-aws-kms/pom.xml
index 506e958..c4c962b 100644
--- a/components/camel-aws-kms/pom.xml
+++ b/components/camel-aws-kms/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws-lambda/pom.xml b/components/camel-aws-lambda/pom.xml
index b5fc19f..64e7499 100644
--- a/components/camel-aws-lambda/pom.xml
+++ b/components/camel-aws-lambda/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws-mq/pom.xml b/components/camel-aws-mq/pom.xml
index 96ce930..88ead88 100644
--- a/components/camel-aws-mq/pom.xml
+++ b/components/camel-aws-mq/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws-msk/pom.xml b/components/camel-aws-msk/pom.xml
index a1a6897..4d8cc2d 100644
--- a/components/camel-aws-msk/pom.xml
+++ b/components/camel-aws-msk/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws-s3/pom.xml b/components/camel-aws-s3/pom.xml
index 70b63ec..a504dbe 100644
--- a/components/camel-aws-s3/pom.xml
+++ b/components/camel-aws-s3/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws-ses/pom.xml b/components/camel-aws-ses/pom.xml
index dae6efe..1d10bae 100644
--- a/components/camel-aws-ses/pom.xml
+++ b/components/camel-aws-ses/pom.xml
@@ -63,6 +63,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws-sns/pom.xml b/components/camel-aws-sns/pom.xml
index bbd4b1b..1c048c8 100644
--- a/components/camel-aws-sns/pom.xml
+++ b/components/camel-aws-sns/pom.xml
@@ -63,6 +63,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws-sqs/pom.xml b/components/camel-aws-sqs/pom.xml
index 5ae9b38..31c7605 100644
--- a/components/camel-aws-sqs/pom.xml
+++ b/components/camel-aws-sqs/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws-swf/pom.xml b/components/camel-aws-swf/pom.xml
index fbd2d77..c642b0f 100644
--- a/components/camel-aws-swf/pom.xml
+++ b/components/camel-aws-swf/pom.xml
@@ -63,6 +63,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-athena/pom.xml b/components/camel-aws2-athena/pom.xml
index 1180efc..467663c 100644
--- a/components/camel-aws2-athena/pom.xml
+++ b/components/camel-aws2-athena/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-cw/pom.xml b/components/camel-aws2-cw/pom.xml
index 9e63097..33bd797 100644
--- a/components/camel-aws2-cw/pom.xml
+++ b/components/camel-aws2-cw/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-ddb/pom.xml b/components/camel-aws2-ddb/pom.xml
index aaaf2ce..f9258fc 100644
--- a/components/camel-aws2-ddb/pom.xml
+++ b/components/camel-aws2-ddb/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-ec2/pom.xml b/components/camel-aws2-ec2/pom.xml
index a5c2626..86310a3 100644
--- a/components/camel-aws2-ec2/pom.xml
+++ b/components/camel-aws2-ec2/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-ecs/pom.xml b/components/camel-aws2-ecs/pom.xml
index 88f9f31..bf9337d 100644
--- a/components/camel-aws2-ecs/pom.xml
+++ b/components/camel-aws2-ecs/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-eks/pom.xml b/components/camel-aws2-eks/pom.xml
index 0ea753c..476f3e6 100644
--- a/components/camel-aws2-eks/pom.xml
+++ b/components/camel-aws2-eks/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-iam/pom.xml b/components/camel-aws2-iam/pom.xml
index 47c2342..55cb61f 100644
--- a/components/camel-aws2-iam/pom.xml
+++ b/components/camel-aws2-iam/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-kinesis/pom.xml b/components/camel-aws2-kinesis/pom.xml
index 7e2ef6d..c9b131b 100644
--- a/components/camel-aws2-kinesis/pom.xml
+++ b/components/camel-aws2-kinesis/pom.xml
@@ -63,6 +63,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-kms/pom.xml b/components/camel-aws2-kms/pom.xml
index c14cd66..4d2e267 100644
--- a/components/camel-aws2-kms/pom.xml
+++ b/components/camel-aws2-kms/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-lambda/pom.xml b/components/camel-aws2-lambda/pom.xml
index 93f4038..89db659c 100644
--- a/components/camel-aws2-lambda/pom.xml
+++ b/components/camel-aws2-lambda/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-mq/pom.xml b/components/camel-aws2-mq/pom.xml
index 06875a6..db97ffe 100644
--- a/components/camel-aws2-mq/pom.xml
+++ b/components/camel-aws2-mq/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-msk/pom.xml b/components/camel-aws2-msk/pom.xml
index bef1194..7abe877 100644
--- a/components/camel-aws2-msk/pom.xml
+++ b/components/camel-aws2-msk/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-s3/pom.xml b/components/camel-aws2-s3/pom.xml
index 500d556..86f550d 100644
--- a/components/camel-aws2-s3/pom.xml
+++ b/components/camel-aws2-s3/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-ses/pom.xml b/components/camel-aws2-ses/pom.xml
index 5a298cd..b18dabf 100644
--- a/components/camel-aws2-ses/pom.xml
+++ b/components/camel-aws2-ses/pom.xml
@@ -63,6 +63,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-sns/pom.xml b/components/camel-aws2-sns/pom.xml
index 02c3d6f..1430d22 100644
--- a/components/camel-aws2-sns/pom.xml
+++ b/components/camel-aws2-sns/pom.xml
@@ -63,6 +63,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-sqs/pom.xml b/components/camel-aws2-sqs/pom.xml
index 25d3056..bc9eeaf 100644
--- a/components/camel-aws2-sqs/pom.xml
+++ b/components/camel-aws2-sqs/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-aws2-sts/pom.xml b/components/camel-aws2-sts/pom.xml
index bc712fc..7a0bff0 100644
--- a/components/camel-aws2-sts/pom.xml
+++ b/components/camel-aws2-sts/pom.xml
@@ -58,6 +58,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-slf4j-impl</artifactId>
             <scope>test</scope>
diff --git a/components/camel-dropbox/pom.xml b/components/camel-dropbox/pom.xml
index c5f47d2..f56235b 100644
--- a/components/camel-dropbox/pom.xml
+++ b/components/camel-dropbox/pom.xml
@@ -71,6 +71,11 @@
             <artifactId>camel-test-junit5</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
 
         <dependency>
             <groupId>org.apache.logging.log4j</groupId>
diff --git a/components/camel-elasticsearch-rest/pom.xml b/components/camel-elasticsearch-rest/pom.xml
index 5a56685..7bcb489 100644
--- a/components/camel-elasticsearch-rest/pom.xml
+++ b/components/camel-elasticsearch-rest/pom.xml
@@ -63,6 +63,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.awaitility</groupId>
             <artifactId>awaitility</artifactId>
             <scope>test</scope>
diff --git a/components/camel-google-mail/pom.xml b/components/camel-google-mail/pom.xml
index 70cb482..037a5b5 100644
--- a/components/camel-google-mail/pom.xml
+++ b/components/camel-google-mail/pom.xml
@@ -98,6 +98,11 @@
             <artifactId>camel-test-junit5</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/components/camel-minio/pom.xml b/components/camel-minio/pom.xml
index 6bec06a..41d5295 100644
--- a/components/camel-minio/pom.xml
+++ b/components/camel-minio/pom.xml
@@ -76,6 +76,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
             <artifactId>camel-testcontainers-junit5</artifactId>
             <scope>test</scope>
         </dependency>
diff --git a/components/camel-paho/pom.xml b/components/camel-paho/pom.xml
index fc61502..05663fe 100644
--- a/components/camel-paho/pom.xml
+++ b/components/camel-paho/pom.xml
@@ -52,6 +52,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.activemq</groupId>
             <artifactId>activemq-broker</artifactId>
             <scope>test</scope>
diff --git a/components/camel-salesforce/camel-salesforce-component/pom.xml b/components/camel-salesforce/camel-salesforce-component/pom.xml
index bfd93d3..c2d3cee 100644
--- a/components/camel-salesforce/camel-salesforce-component/pom.xml
+++ b/components/camel-salesforce/camel-salesforce-component/pom.xml
@@ -225,6 +225,11 @@
             <version>${awaitility-version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/components/camel-slack/pom.xml b/components/camel-slack/pom.xml
index e9a527e..0a82970 100644
--- a/components/camel-slack/pom.xml
+++ b/components/camel-slack/pom.xml
@@ -71,6 +71,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
             <artifactId>camel-undertow</artifactId>
             <scope>test</scope>
         </dependency>
diff --git a/components/camel-twitter/pom.xml b/components/camel-twitter/pom.xml
index e05685c..4c5eb75 100644
--- a/components/camel-twitter/pom.xml
+++ b/components/camel-twitter/pom.xml
@@ -53,6 +53,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.junit.jupiter</groupId>
             <artifactId>junit-jupiter</artifactId>
             <scope>test</scope>
diff --git a/components/camel-undertow/pom.xml b/components/camel-undertow/pom.xml
index 3231b78..f9ca4cb 100644
--- a/components/camel-undertow/pom.xml
+++ b/components/camel-undertow/pom.xml
@@ -74,6 +74,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
+            <artifactId>camel-core-catalog</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
             <artifactId>camel-http</artifactId>
             <scope>test</scope>
         </dependency>