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 2024/03/29 10:47:51 UTC

(camel) branch hfs created (now c37c9363f78)

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

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


      at c37c9363f78 CAMEL-20629: camel-platform-http-vertx - Header filter strategy should be HttpHeaderFilterStrategy

This branch includes the following new commits:

     new c37c9363f78 CAMEL-20629: camel-platform-http-vertx - Header filter strategy should be HttpHeaderFilterStrategy

The 1 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.



(camel) 01/01: CAMEL-20629: camel-platform-http-vertx - Header filter strategy should be HttpHeaderFilterStrategy

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

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

commit c37c9363f784af0aab24f4505136370be6eb567a
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Mar 29 11:46:20 2024 +0100

    CAMEL-20629: camel-platform-http-vertx - Header filter strategy should be HttpHeaderFilterStrategy
---
 .../org/apache/camel/catalog/components/platform-http.json          | 3 ++-
 components/camel-platform-http-vertx/pom.xml                        | 4 ----
 components/camel-platform-http/pom.xml                              | 2 +-
 .../component/platform/http/PlatformHttpComponentConfigurer.java    | 6 ++++++
 .../org/apache/camel/component/platform/http/platform-http.json     | 3 ++-
 .../apache/camel/component/platform/http/PlatformHttpComponent.java | 5 +++--
 .../apache/camel/component/platform/http/PlatformHttpEndpoint.java  | 3 ++-
 .../component/platform/http/PlatformHttpHeaderFilterStrategy.java   | 3 +++
 docs/components/modules/ROOT/nav.adoc                               | 2 +-
 9 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/platform-http.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/platform-http.json
index 692a7194587..1de2c61e43f 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/platform-http.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/platform-http.json
@@ -26,7 +26,8 @@
   "componentProperties": {
     "bridgeErrorHandler": { "index": 0, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the like [...]
     "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "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 t [...]
-    "engine": { "index": 2, "kind": "property", "displayName": "Engine", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.platform.http.spi.PlatformHttpEngine", "deprecated": false, "autowired": false, "secret": false, "description": "An HTTP Server engine implementation to serve the requests" }
+    "engine": { "index": 2, "kind": "property", "displayName": "Engine", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.platform.http.spi.PlatformHttpEngine", "deprecated": false, "autowired": false, "secret": false, "description": "An HTTP Server engine implementation to serve the requests" },
+    "headerFilterStrategy": { "index": 3, "kind": "property", "displayName": "Header Filter Strategy", "group": "filter", "label": "filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message." }
   },
   "properties": {
     "path": { "index": 0, "kind": "path", "displayName": "Path", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The path under which this endpoint serves the HTTP requests, for proxy use 'proxy'" },
diff --git a/components/camel-platform-http-vertx/pom.xml b/components/camel-platform-http-vertx/pom.xml
index 49856df7660..6f1672695df 100644
--- a/components/camel-platform-http-vertx/pom.xml
+++ b/components/camel-platform-http-vertx/pom.xml
@@ -42,10 +42,6 @@
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-platform-http</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-attachments</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-vertx-common</artifactId>
diff --git a/components/camel-platform-http/pom.xml b/components/camel-platform-http/pom.xml
index fc06345608f..a14c76dde15 100644
--- a/components/camel-platform-http/pom.xml
+++ b/components/camel-platform-http/pom.xml
@@ -35,7 +35,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel</groupId>
-            <artifactId>camel-support</artifactId>
+            <artifactId>camel-http-common</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
diff --git a/components/camel-platform-http/src/generated/java/org/apache/camel/component/platform/http/PlatformHttpComponentConfigurer.java b/components/camel-platform-http/src/generated/java/org/apache/camel/component/platform/http/PlatformHttpComponentConfigurer.java
index 18801fe02e8..9c5f1d28434 100644
--- a/components/camel-platform-http/src/generated/java/org/apache/camel/component/platform/http/PlatformHttpComponentConfigurer.java
+++ b/components/camel-platform-http/src/generated/java/org/apache/camel/component/platform/http/PlatformHttpComponentConfigurer.java
@@ -26,6 +26,8 @@ public class PlatformHttpComponentConfigurer extends PropertyConfigurerSupport i
         case "bridgeerrorhandler":
         case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
         case "engine": target.setEngine(property(camelContext, org.apache.camel.component.platform.http.spi.PlatformHttpEngine.class, value)); return true;
+        case "headerfilterstrategy":
+        case "headerFilterStrategy": target.setHeaderFilterStrategy(property(camelContext, org.apache.camel.spi.HeaderFilterStrategy.class, value)); return true;
         default: return false;
         }
     }
@@ -38,6 +40,8 @@ public class PlatformHttpComponentConfigurer extends PropertyConfigurerSupport i
         case "bridgeerrorhandler":
         case "bridgeErrorHandler": return boolean.class;
         case "engine": return org.apache.camel.component.platform.http.spi.PlatformHttpEngine.class;
+        case "headerfilterstrategy":
+        case "headerFilterStrategy": return org.apache.camel.spi.HeaderFilterStrategy.class;
         default: return null;
         }
     }
@@ -51,6 +55,8 @@ public class PlatformHttpComponentConfigurer extends PropertyConfigurerSupport i
         case "bridgeerrorhandler":
         case "bridgeErrorHandler": return target.isBridgeErrorHandler();
         case "engine": return target.getEngine();
+        case "headerfilterstrategy":
+        case "headerFilterStrategy": return target.getHeaderFilterStrategy();
         default: return null;
         }
     }
diff --git a/components/camel-platform-http/src/generated/resources/META-INF/org/apache/camel/component/platform/http/platform-http.json b/components/camel-platform-http/src/generated/resources/META-INF/org/apache/camel/component/platform/http/platform-http.json
index 692a7194587..1de2c61e43f 100644
--- a/components/camel-platform-http/src/generated/resources/META-INF/org/apache/camel/component/platform/http/platform-http.json
+++ b/components/camel-platform-http/src/generated/resources/META-INF/org/apache/camel/component/platform/http/platform-http.json
@@ -26,7 +26,8 @@
   "componentProperties": {
     "bridgeErrorHandler": { "index": 0, "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the like [...]
     "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "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 t [...]
-    "engine": { "index": 2, "kind": "property", "displayName": "Engine", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.platform.http.spi.PlatformHttpEngine", "deprecated": false, "autowired": false, "secret": false, "description": "An HTTP Server engine implementation to serve the requests" }
+    "engine": { "index": 2, "kind": "property", "displayName": "Engine", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.platform.http.spi.PlatformHttpEngine", "deprecated": false, "autowired": false, "secret": false, "description": "An HTTP Server engine implementation to serve the requests" },
+    "headerFilterStrategy": { "index": 3, "kind": "property", "displayName": "Header Filter Strategy", "group": "filter", "label": "filter", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message." }
   },
   "properties": {
     "path": { "index": 0, "kind": "path", "displayName": "Path", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The path under which this endpoint serves the HTTP requests, for proxy use 'proxy'" },
diff --git a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpComponent.java b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpComponent.java
index 5e8b15740ef..0ce0ee76dfb 100644
--- a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpComponent.java
+++ b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpComponent.java
@@ -37,7 +37,7 @@ import org.apache.camel.spi.RestConsumerFactory;
 import org.apache.camel.spi.RestOpenApiConsumerFactory;
 import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.support.CamelContextHelper;
-import org.apache.camel.support.DefaultComponent;
+import org.apache.camel.support.HeaderFilterStrategyComponent;
 import org.apache.camel.support.RestComponentHelper;
 import org.apache.camel.support.service.ServiceHelper;
 import org.apache.camel.util.FileUtil;
@@ -49,7 +49,7 @@ import org.slf4j.LoggerFactory;
  * Exposes HTTP endpoints leveraging the given platform's (SpringBoot, WildFly, Quarkus, ...) HTTP server.
  */
 @Component("platform-http")
-public class PlatformHttpComponent extends DefaultComponent
+public class PlatformHttpComponent extends HeaderFilterStrategyComponent
         implements RestConsumerFactory, RestApiConsumerFactory, RestOpenApiConsumerFactory {
 
     private static final Logger LOG = LoggerFactory.getLogger(PlatformHttpComponent.class);
@@ -77,6 +77,7 @@ public class PlatformHttpComponent extends DefaultComponent
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
         PlatformHttpEndpoint endpoint = new PlatformHttpEndpoint(uri, remaining, this);
         endpoint.setPlatformHttpEngine(engine);
+        setEndpointHeaderFilterStrategy(endpoint);
         setProperties(endpoint, parameters);
         return endpoint;
     }
diff --git a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpEndpoint.java b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpEndpoint.java
index 7cf295a1022..5ed05979ebf 100644
--- a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpEndpoint.java
+++ b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpEndpoint.java
@@ -24,6 +24,7 @@ import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.component.platform.http.cookie.CookieConfiguration;
 import org.apache.camel.component.platform.http.spi.PlatformHttpEngine;
+import org.apache.camel.http.common.HttpHeaderFilterStrategy;
 import org.apache.camel.spi.HeaderFilterStrategy;
 import org.apache.camel.spi.HeaderFilterStrategyAware;
 import org.apache.camel.spi.Metadata;
@@ -72,7 +73,7 @@ public class PlatformHttpEndpoint extends DefaultEndpoint implements AsyncEndpoi
     private PlatformHttpEngine platformHttpEngine;
     @UriParam(label = "advanced",
               description = "To use a custom HeaderFilterStrategy to filter headers to and from Camel message.")
-    private HeaderFilterStrategy headerFilterStrategy = new PlatformHttpHeaderFilterStrategy();
+    private HeaderFilterStrategy headerFilterStrategy = new HttpHeaderFilterStrategy();
     @UriParam(label = "advanced,consumer",
               description = "Whether to use streaming for large requests and responses (currently only supported by camel-platform-http-vertx)")
     private boolean useStreaming;
diff --git a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpHeaderFilterStrategy.java b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpHeaderFilterStrategy.java
index b3981e45f3e..3621d67280e 100644
--- a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpHeaderFilterStrategy.java
+++ b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpHeaderFilterStrategy.java
@@ -23,7 +23,10 @@ import org.apache.camel.support.http.HttpUtil;
  * A copy of {@code org.apache.camel.http.common.HttpHeaderFilterStrategy}. Keep in sync or refactor
  * {@code camel-http-common} not to depend on {@code jakarta.servlet-api} and then use the
  * {@code HttpHeaderFilterStrategy} from there.
+ *
+ * @deprecated  use {@link org.apache.camel.http.common.HttpHeaderFilterStrategy} instead.
  */
+@Deprecated
 public class PlatformHttpHeaderFilterStrategy extends DefaultHeaderFilterStrategy {
 
     public PlatformHttpHeaderFilterStrategy() {
diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc
index beefb8c4749..21bb84dc46d 100644
--- a/docs/components/modules/ROOT/nav.adoc
+++ b/docs/components/modules/ROOT/nav.adoc
@@ -122,7 +122,7 @@
 *** xref:google-mail-component.adoc[Google Mail]
 *** xref:google-mail-stream-component.adoc[Google Mail Stream]
 *** xref:google-pubsub-component.adoc[Google Pubsub]
-*** xref:google-pubsub-lite-component.adoc[Google Pubsub Lite]
+*** xref:google-pubsub-lite-component.adoc[Google PubSub Lite]
 *** xref:google-secret-manager-component.adoc[Google Secret Manager]
 *** xref:google-sheets-component.adoc[Google Sheets]
 *** xref:google-sheets-stream-component.adoc[Google Sheets Stream]