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/02/26 06:47:51 UTC

[camel] branch master updated (8f6d432 -> 1597870)

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 8f6d432  Upgrade AWS SDK v2 to version 2.16.7
     new b7c718a  camel-http - polished
     new 30e9be4  CAMEL-16264: camel-http - Add option to ignore response headers
     new a5068fd  camel-http - Optimize a bit
     new d988d47  CAMEL-16264: camel-http - Add option to ignore request headers
     new d3ff83c  CAMEL-16264: camel-http - Allow to configure these on component level.
     new 1597870  CAMEL-16264: camel-http - Allow to configure these on component level.

The 6 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:
 .../apache/camel/catalog/docs/http-component.adoc  |   9 +-
 .../component/http/HttpComponentConfigurer.java    |  18 ++
 .../component/http/HttpEndpointConfigurer.java     |  12 ++
 .../component/http/HttpEndpointUriFactory.java     |   4 +-
 .../org/apache/camel/component/http/http.json      |   5 +
 .../org/apache/camel/component/http/https.json     |   5 +
 .../camel-http/src/main/docs/http-component.adoc   |   9 +-
 .../apache/camel/component/http/HttpComponent.java |  56 +++++-
 .../component/http/HttpDeleteWithBodyMethod.java   |   5 +
 .../apache/camel/component/http/HttpEndpoint.java  |  35 ++++
 .../camel/component/http/HttpEntityConverter.java  |  18 +-
 .../component/http/HttpGetWithBodyMethod.java      |   5 +
 .../apache/camel/component/http/HttpMethods.java   |  25 +++
 .../apache/camel/component/http/HttpProducer.java  | 198 +++++++++++----------
 .../component/dsl/HttpComponentBuilderFactory.java |  59 ++++++
 .../dsl/HttpsComponentBuilderFactory.java          |  59 ++++++
 .../endpoint/dsl/HttpEndpointBuilderFactory.java   |  78 ++++++++
 .../modules/ROOT/pages/http-component.adoc         |   9 +-
 18 files changed, 499 insertions(+), 110 deletions(-)


[camel] 05/06: CAMEL-16264: camel-http - Allow to configure these on component level.

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 d3ff83c6a571e4b041d7dcd7fe884958ceb7752c
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Feb 26 07:44:39 2021 +0100

    CAMEL-16264: camel-http - Allow to configure these on component level.
---
 .../apache/camel/catalog/docs/http-component.adoc  |   9 +-
 .../component/http/HttpComponentConfigurer.java    |  18 +++
 .../org/apache/camel/component/http/http.json      |   7 +-
 .../org/apache/camel/component/http/https.json     |   7 +-
 .../camel-http/src/main/docs/http-component.adoc   |   9 +-
 .../apache/camel/component/http/HttpComponent.java |  42 ++++++
 .../apache/camel/component/http/HttpEndpoint.java  |   4 +-
 .../component/dsl/HttpComponentBuilderFactory.java |  59 ++++++++
 .../dsl/HttpsComponentBuilderFactory.java          |  59 ++++++++
 .../endpoint/dsl/HttpEndpointBuilderFactory.java   | 156 ++++++++++-----------
 .../modules/ROOT/pages/http-component.adoc         |   9 +-
 11 files changed, 286 insertions(+), 93 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/http-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/http-component.adoc
index 9171e16..e048a42 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/http-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/http-component.adoc
@@ -54,7 +54,7 @@ route, use the xref:jetty-component.adoc[Jetty Component] instead.
 
 
 // component options: START
-The HTTP component supports 34 options, which are listed below.
+The HTTP component supports 37 options, which are listed below.
 
 
 
@@ -62,8 +62,11 @@ The HTTP component supports 34 options, which are listed below.
 |===
 | Name | Description | Default | Type
 | *cookieStore* (producer) | To use a custom org.apache.http.client.CookieStore. By default the org.apache.http.impl.client.BasicCookieStore is used which is an in-memory only cookie store. Notice if bridgeEndpoint=true then the cookie store is forced to be a noop cookie store as cookie shouldn't be stored as we are just bridging (eg acting as a proxy). |  | CookieStore
+| *copyHeaders* (producer) | If this option is true then IN exchange headers will be copied to OUT exchange headers according to copy strategy. Setting this to false, allows to only include the headers from the HTTP response (not propagating IN headers). | true | boolean
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *responsePayloadStreaming{zwsp}Threshold* (producer) | This threshold in bytes controls whether the response payload should be stored in memory as a byte array or be streaming based. Set this to -1 to always use streaming mode. | 8192 | int
+| *skipRequestHeaders* (producer) | Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
+| *skipResponseHeaders* (producer) | Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *allowJavaSerializedObject* (advanced) | Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object. This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk. | false | boolean
 | *authCachingDisabled* (advanced) | Disables authentication scheme caching | false | boolean
 | *automaticRetriesDisabled* (advanced) | Disables automatic request recovery and re-execution | false | boolean
@@ -152,6 +155,8 @@ with the following path and query parameters:
 | *deleteWithBody* (producer) | Whether the HTTP DELETE should include the message body or not. By default HTTP DELETE do not include any HTTP body. However in some rare cases users may need to be able to include the message body. | false | boolean
 | *getWithBody* (producer) | Whether the HTTP GET should include the message body or not. By default HTTP GET do not include any HTTP body. However in some rare cases users may need to be able to include the message body. | false | boolean
 | *okStatusCodeRange* (producer) | The status codes which are considered a success response. The values are inclusive. Multiple ranges can be defined, separated by comma, e.g. 200-204,209,301-304. Each range must be a single number or from-to with the dash included. | 200-299 | String
+| *skipRequestHeaders* (producer) | Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
+| *skipResponseHeaders* (producer) | Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *clientBuilder* (advanced) | Provide access to the http client request parameters used on new RequestConfig instances used by producers or consumers of this endpoint. |  | HttpClientBuilder
 | *clientConnectionManager* (advanced) | To use a custom HttpClientConnectionManager to manage connections |  | HttpClientConnectionManager
 | *connectionsPerRoute* (advanced) | The maximum number of connections per route. | 20 | int
@@ -161,8 +166,6 @@ with the following path and query parameters:
 | *httpContext* (advanced) | To use a custom HttpContext instance |  | HttpContext
 | *maxTotalConnections* (advanced) | The maximum number of connections. | 200 | int
 | *useSystemProperties* (advanced) | To use System Properties as fallback for configuration | false | boolean
-| *skipRequestHeaders* (producer.advanced) | Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
-| *skipResponseHeaders* (producer.advanced) | Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *proxyAuthDomain* (proxy) | Proxy authentication domain to use with NTML |  | String
 | *proxyAuthHost* (proxy) | Proxy authentication host |  | String
 | *proxyAuthMethod* (proxy) | Proxy authentication method to use. There are 3 enums and the value can be one of: Basic, Digest, NTLM |  | String
diff --git a/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpComponentConfigurer.java b/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpComponentConfigurer.java
index 4996f9c..ec5c758 100644
--- a/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpComponentConfigurer.java
+++ b/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpComponentConfigurer.java
@@ -47,6 +47,8 @@ public class HttpComponentConfigurer extends PropertyConfigurerSupport implement
         case "cookieManagementDisabled": target.setCookieManagementDisabled(property(camelContext, boolean.class, value)); return true;
         case "cookiestore":
         case "cookieStore": target.setCookieStore(property(camelContext, org.apache.http.client.CookieStore.class, value)); return true;
+        case "copyheaders":
+        case "copyHeaders": target.setCopyHeaders(property(camelContext, boolean.class, value)); return true;
         case "defaultuseragentdisabled":
         case "defaultUserAgentDisabled": target.setDefaultUserAgentDisabled(property(camelContext, boolean.class, value)); return true;
         case "headerfilterstrategy":
@@ -81,6 +83,10 @@ public class HttpComponentConfigurer extends PropertyConfigurerSupport implement
         case "redirectHandlingDisabled": target.setRedirectHandlingDisabled(property(camelContext, boolean.class, value)); return true;
         case "responsepayloadstreamingthreshold":
         case "responsePayloadStreamingThreshold": target.setResponsePayloadStreamingThreshold(property(camelContext, int.class, value)); return true;
+        case "skiprequestheaders":
+        case "skipRequestHeaders": target.setSkipRequestHeaders(property(camelContext, boolean.class, value)); return true;
+        case "skipresponseheaders":
+        case "skipResponseHeaders": target.setSkipResponseHeaders(property(camelContext, boolean.class, value)); return true;
         case "sockettimeout":
         case "socketTimeout": target.setSocketTimeout(property(camelContext, int.class, value)); return true;
         case "sslcontextparameters":
@@ -122,6 +128,8 @@ public class HttpComponentConfigurer extends PropertyConfigurerSupport implement
         case "cookieManagementDisabled": return boolean.class;
         case "cookiestore":
         case "cookieStore": return org.apache.http.client.CookieStore.class;
+        case "copyheaders":
+        case "copyHeaders": return boolean.class;
         case "defaultuseragentdisabled":
         case "defaultUserAgentDisabled": return boolean.class;
         case "headerfilterstrategy":
@@ -156,6 +164,10 @@ public class HttpComponentConfigurer extends PropertyConfigurerSupport implement
         case "redirectHandlingDisabled": return boolean.class;
         case "responsepayloadstreamingthreshold":
         case "responsePayloadStreamingThreshold": return int.class;
+        case "skiprequestheaders":
+        case "skipRequestHeaders": return boolean.class;
+        case "skipresponseheaders":
+        case "skipResponseHeaders": return boolean.class;
         case "sockettimeout":
         case "socketTimeout": return int.class;
         case "sslcontextparameters":
@@ -198,6 +210,8 @@ public class HttpComponentConfigurer extends PropertyConfigurerSupport implement
         case "cookieManagementDisabled": return target.isCookieManagementDisabled();
         case "cookiestore":
         case "cookieStore": return target.getCookieStore();
+        case "copyheaders":
+        case "copyHeaders": return target.isCopyHeaders();
         case "defaultuseragentdisabled":
         case "defaultUserAgentDisabled": return target.isDefaultUserAgentDisabled();
         case "headerfilterstrategy":
@@ -232,6 +246,10 @@ public class HttpComponentConfigurer extends PropertyConfigurerSupport implement
         case "redirectHandlingDisabled": return target.isRedirectHandlingDisabled();
         case "responsepayloadstreamingthreshold":
         case "responsePayloadStreamingThreshold": return target.getResponsePayloadStreamingThreshold();
+        case "skiprequestheaders":
+        case "skipRequestHeaders": return target.isSkipRequestHeaders();
+        case "skipresponseheaders":
+        case "skipResponseHeaders": return target.isSkipResponseHeaders();
         case "sockettimeout":
         case "socketTimeout": return target.getSocketTimeout();
         case "sslcontextparameters":
diff --git a/components/camel-http/src/generated/resources/org/apache/camel/component/http/http.json b/components/camel-http/src/generated/resources/org/apache/camel/component/http/http.json
index 3329ee8..3009616 100644
--- a/components/camel-http/src/generated/resources/org/apache/camel/component/http/http.json
+++ b/components/camel-http/src/generated/resources/org/apache/camel/component/http/http.json
@@ -25,8 +25,11 @@
   },
   "componentProperties": {
     "cookieStore": { "kind": "property", "displayName": "Cookie Store", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.http.client.CookieStore", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom org.apache.http.client.CookieStore. By default the org.apache.http.impl.client.BasicCookieStore is used which is an in-memory only cookie store. Notice if bridgeEndpoint=true then the cookie store is f [...]
+    "copyHeaders": { "kind": "property", "displayName": "Copy Headers", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "If this option is true then IN exchange headers will be copied to OUT exchange headers according to copy strategy. Setting this to false, allows to only include the headers from the HTTP response (not propagating IN heade [...]
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
     "responsePayloadStreamingThreshold": { "kind": "property", "displayName": "Response Payload Streaming Threshold", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 8192, "description": "This threshold in bytes controls whether the response payload should be stored in memory as a byte array or be streaming based. Set this to -1 to always use streaming mode." },
+    "skipRequestHeaders": { "kind": "property", "displayName": "Skip Request Headers", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing over [...]
+    "skipResponseHeaders": { "kind": "property", "displayName": "Skip Response Headers", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations [...]
     "allowJavaSerializedObject": { "kind": "property", "displayName": "Allow Java Serialized Object", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to allow java serialization when a request uses context-type=application\/x-java-serialized-object. This is by default turned off. If you enable this then be aware that Java will des [...]
     "authCachingDisabled": { "kind": "property", "displayName": "Auth Caching Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Disables authentication scheme caching" },
     "automaticRetriesDisabled": { "kind": "property", "displayName": "Automatic Retries Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Disables automatic request recovery and re-execution" },
@@ -81,6 +84,8 @@
     "deleteWithBody": { "kind": "parameter", "displayName": "Delete With Body", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the HTTP DELETE should include the message body or not. By default HTTP DELETE do not include any HTTP body. However in some rare cases users may need to be able to include the message [...]
     "getWithBody": { "kind": "parameter", "displayName": "Get With Body", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the HTTP GET should include the message body or not. By default HTTP GET do not include any HTTP body. However in some rare cases users may need to be able to include the message body." },
     "okStatusCodeRange": { "kind": "parameter", "displayName": "Ok Status Code Range", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "200-299", "description": "The status codes which are considered a success response. The values are inclusive. Multiple ranges can be defined, separated by comma, e.g. 200-204,209,301-304. Each range  [...]
+    "skipRequestHeaders": { "kind": "parameter", "displayName": "Skip Request Headers", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing ove [...]
+    "skipResponseHeaders": { "kind": "parameter", "displayName": "Skip Response Headers", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocation [...]
     "clientBuilder": { "kind": "parameter", "displayName": "Client Builder", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.impl.client.HttpClientBuilder", "deprecated": false, "autowired": false, "secret": false, "description": "Provide access to the http client request parameters used on new RequestConfig instances used by producers or consumers of this endpoint." },
     "clientConnectionManager": { "kind": "parameter", "displayName": "Client Connection Manager", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.conn.HttpClientConnectionManager", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom HttpClientConnectionManager to manage connections" },
     "connectionsPerRoute": { "kind": "parameter", "displayName": "Connections Per Route", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 20, "description": "The maximum number of connections per route." },
@@ -90,8 +95,6 @@
     "httpContext": { "kind": "parameter", "displayName": "Http Context", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.protocol.HttpContext", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom HttpContext instance" },
     "maxTotalConnections": { "kind": "parameter", "displayName": "Max Total Connections", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 200, "description": "The maximum number of connections." },
     "useSystemProperties": { "kind": "parameter", "displayName": "Use System Properties", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To use System Properties as fallback for configuration" },
-    "skipRequestHeaders": { "kind": "parameter", "displayName": "Skip Request Headers", "group": "producer.advanced", "label": "producer.advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overh [...]
-    "skipResponseHeaders": { "kind": "parameter", "displayName": "Skip Response Headers", "group": "producer.advanced", "label": "producer.advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations  [...]
     "proxyAuthDomain": { "kind": "parameter", "displayName": "Proxy Auth Domain", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication domain to use with NTML" },
     "proxyAuthHost": { "kind": "parameter", "displayName": "Proxy Auth Host", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication host" },
     "proxyAuthMethod": { "kind": "parameter", "displayName": "Proxy Auth Method", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "Basic", "Digest", "NTLM" ], "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication method to use" },
diff --git a/components/camel-http/src/generated/resources/org/apache/camel/component/http/https.json b/components/camel-http/src/generated/resources/org/apache/camel/component/http/https.json
index 209faf2..aedd1ea 100644
--- a/components/camel-http/src/generated/resources/org/apache/camel/component/http/https.json
+++ b/components/camel-http/src/generated/resources/org/apache/camel/component/http/https.json
@@ -25,8 +25,11 @@
   },
   "componentProperties": {
     "cookieStore": { "kind": "property", "displayName": "Cookie Store", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.http.client.CookieStore", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom org.apache.http.client.CookieStore. By default the org.apache.http.impl.client.BasicCookieStore is used which is an in-memory only cookie store. Notice if bridgeEndpoint=true then the cookie store is f [...]
+    "copyHeaders": { "kind": "property", "displayName": "Copy Headers", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "If this option is true then IN exchange headers will be copied to OUT exchange headers according to copy strategy. Setting this to false, allows to only include the headers from the HTTP response (not propagating IN heade [...]
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
     "responsePayloadStreamingThreshold": { "kind": "property", "displayName": "Response Payload Streaming Threshold", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 8192, "description": "This threshold in bytes controls whether the response payload should be stored in memory as a byte array or be streaming based. Set this to -1 to always use streaming mode." },
+    "skipRequestHeaders": { "kind": "property", "displayName": "Skip Request Headers", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing over [...]
+    "skipResponseHeaders": { "kind": "property", "displayName": "Skip Response Headers", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations [...]
     "allowJavaSerializedObject": { "kind": "property", "displayName": "Allow Java Serialized Object", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to allow java serialization when a request uses context-type=application\/x-java-serialized-object. This is by default turned off. If you enable this then be aware that Java will des [...]
     "authCachingDisabled": { "kind": "property", "displayName": "Auth Caching Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Disables authentication scheme caching" },
     "automaticRetriesDisabled": { "kind": "property", "displayName": "Automatic Retries Disabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Disables automatic request recovery and re-execution" },
@@ -81,6 +84,8 @@
     "deleteWithBody": { "kind": "parameter", "displayName": "Delete With Body", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the HTTP DELETE should include the message body or not. By default HTTP DELETE do not include any HTTP body. However in some rare cases users may need to be able to include the message [...]
     "getWithBody": { "kind": "parameter", "displayName": "Get With Body", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the HTTP GET should include the message body or not. By default HTTP GET do not include any HTTP body. However in some rare cases users may need to be able to include the message body." },
     "okStatusCodeRange": { "kind": "parameter", "displayName": "Ok Status Code Range", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "200-299", "description": "The status codes which are considered a success response. The values are inclusive. Multiple ranges can be defined, separated by comma, e.g. 200-204,209,301-304. Each range  [...]
+    "skipRequestHeaders": { "kind": "parameter", "displayName": "Skip Request Headers", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing ove [...]
+    "skipResponseHeaders": { "kind": "parameter", "displayName": "Skip Response Headers", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocation [...]
     "clientBuilder": { "kind": "parameter", "displayName": "Client Builder", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.impl.client.HttpClientBuilder", "deprecated": false, "autowired": false, "secret": false, "description": "Provide access to the http client request parameters used on new RequestConfig instances used by producers or consumers of this endpoint." },
     "clientConnectionManager": { "kind": "parameter", "displayName": "Client Connection Manager", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.conn.HttpClientConnectionManager", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom HttpClientConnectionManager to manage connections" },
     "connectionsPerRoute": { "kind": "parameter", "displayName": "Connections Per Route", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 20, "description": "The maximum number of connections per route." },
@@ -90,8 +95,6 @@
     "httpContext": { "kind": "parameter", "displayName": "Http Context", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.protocol.HttpContext", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom HttpContext instance" },
     "maxTotalConnections": { "kind": "parameter", "displayName": "Max Total Connections", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 200, "description": "The maximum number of connections." },
     "useSystemProperties": { "kind": "parameter", "displayName": "Use System Properties", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To use System Properties as fallback for configuration" },
-    "skipRequestHeaders": { "kind": "parameter", "displayName": "Skip Request Headers", "group": "producer.advanced", "label": "producer.advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overh [...]
-    "skipResponseHeaders": { "kind": "parameter", "displayName": "Skip Response Headers", "group": "producer.advanced", "label": "producer.advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations  [...]
     "proxyAuthDomain": { "kind": "parameter", "displayName": "Proxy Auth Domain", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication domain to use with NTML" },
     "proxyAuthHost": { "kind": "parameter", "displayName": "Proxy Auth Host", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication host" },
     "proxyAuthMethod": { "kind": "parameter", "displayName": "Proxy Auth Method", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "Basic", "Digest", "NTLM" ], "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication method to use" },
diff --git a/components/camel-http/src/main/docs/http-component.adoc b/components/camel-http/src/main/docs/http-component.adoc
index 9171e16..e048a42 100644
--- a/components/camel-http/src/main/docs/http-component.adoc
+++ b/components/camel-http/src/main/docs/http-component.adoc
@@ -54,7 +54,7 @@ route, use the xref:jetty-component.adoc[Jetty Component] instead.
 
 
 // component options: START
-The HTTP component supports 34 options, which are listed below.
+The HTTP component supports 37 options, which are listed below.
 
 
 
@@ -62,8 +62,11 @@ The HTTP component supports 34 options, which are listed below.
 |===
 | Name | Description | Default | Type
 | *cookieStore* (producer) | To use a custom org.apache.http.client.CookieStore. By default the org.apache.http.impl.client.BasicCookieStore is used which is an in-memory only cookie store. Notice if bridgeEndpoint=true then the cookie store is forced to be a noop cookie store as cookie shouldn't be stored as we are just bridging (eg acting as a proxy). |  | CookieStore
+| *copyHeaders* (producer) | If this option is true then IN exchange headers will be copied to OUT exchange headers according to copy strategy. Setting this to false, allows to only include the headers from the HTTP response (not propagating IN headers). | true | boolean
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *responsePayloadStreaming{zwsp}Threshold* (producer) | This threshold in bytes controls whether the response payload should be stored in memory as a byte array or be streaming based. Set this to -1 to always use streaming mode. | 8192 | int
+| *skipRequestHeaders* (producer) | Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
+| *skipResponseHeaders* (producer) | Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *allowJavaSerializedObject* (advanced) | Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object. This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk. | false | boolean
 | *authCachingDisabled* (advanced) | Disables authentication scheme caching | false | boolean
 | *automaticRetriesDisabled* (advanced) | Disables automatic request recovery and re-execution | false | boolean
@@ -152,6 +155,8 @@ with the following path and query parameters:
 | *deleteWithBody* (producer) | Whether the HTTP DELETE should include the message body or not. By default HTTP DELETE do not include any HTTP body. However in some rare cases users may need to be able to include the message body. | false | boolean
 | *getWithBody* (producer) | Whether the HTTP GET should include the message body or not. By default HTTP GET do not include any HTTP body. However in some rare cases users may need to be able to include the message body. | false | boolean
 | *okStatusCodeRange* (producer) | The status codes which are considered a success response. The values are inclusive. Multiple ranges can be defined, separated by comma, e.g. 200-204,209,301-304. Each range must be a single number or from-to with the dash included. | 200-299 | String
+| *skipRequestHeaders* (producer) | Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
+| *skipResponseHeaders* (producer) | Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *clientBuilder* (advanced) | Provide access to the http client request parameters used on new RequestConfig instances used by producers or consumers of this endpoint. |  | HttpClientBuilder
 | *clientConnectionManager* (advanced) | To use a custom HttpClientConnectionManager to manage connections |  | HttpClientConnectionManager
 | *connectionsPerRoute* (advanced) | The maximum number of connections per route. | 20 | int
@@ -161,8 +166,6 @@ with the following path and query parameters:
 | *httpContext* (advanced) | To use a custom HttpContext instance |  | HttpContext
 | *maxTotalConnections* (advanced) | The maximum number of connections. | 200 | int
 | *useSystemProperties* (advanced) | To use System Properties as fallback for configuration | false | boolean
-| *skipRequestHeaders* (producer.advanced) | Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
-| *skipResponseHeaders* (producer.advanced) | Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *proxyAuthDomain* (proxy) | Proxy authentication domain to use with NTML |  | String
 | *proxyAuthHost* (proxy) | Proxy authentication host |  | String
 | *proxyAuthMethod* (proxy) | Proxy authentication method to use. There are 3 enums and the value can be one of: Basic, Digest, NTLM |  | String
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
index 568c53f..4b4ef65 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
@@ -167,6 +167,21 @@ public class HttpComponent extends HttpCommonComponent implements RestProducerFa
     @Metadata(label = "advanced",
               description = "Disables the default user agent set by this builder if none has been provided by the user")
     private boolean defaultUserAgentDisabled;
+    @Metadata(label = "producer",
+              defaultValue = "true",
+              description = "If this option is true then IN exchange headers will be copied to OUT exchange headers according to copy strategy."
+                            + " Setting this to false, allows to only include the headers from the HTTP response (not propagating IN headers).")
+    boolean copyHeaders = true;
+    @Metadata(label = "producer,advanced",
+              description = "Whether to skip mapping all the Camel headers as HTTP request headers."
+                            + " If there are no data from Camel headers needed to be included in the HTTP request then this can avoid"
+                            + " parsing overhead with many object allocations for the JVM garbage collector.")
+    private boolean skipRequestHeaders;
+    @Metadata(label = "producer,advanced",
+              description = "Whether to skip mapping all the HTTP response headers to Camel headers."
+                            + " If there are no data needed from HTTP headers then this can avoid parsing overhead"
+                            + " with many object allocations for the JVM garbage collector.")
+    private boolean skipResponseHeaders;
 
     public HttpComponent() {
         this(HttpEndpoint.class);
@@ -343,6 +358,9 @@ public class HttpComponent extends HttpCommonComponent implements RestProducerFa
         LOG.debug("Creating endpoint uri {}", endpointUriString);
         final HttpClientConnectionManager localConnectionManager = createConnectionManager(parameters, sslContextParameters);
         HttpEndpoint endpoint = new HttpEndpoint(endpointUriString, this, clientBuilder, localConnectionManager, configurer);
+        endpoint.setCopyHeaders(copyHeaders);
+        endpoint.setSkipRequestHeaders(skipRequestHeaders);
+        endpoint.setSkipResponseHeaders(skipResponseHeaders);
 
         // configure the endpoint with the common configuration from the component
         if (getHttpConfiguration() != null) {
@@ -870,6 +888,30 @@ public class HttpComponent extends HttpCommonComponent implements RestProducerFa
         this.defaultUserAgentDisabled = defaultUserAgentDisabled;
     }
 
+    public boolean isCopyHeaders() {
+        return copyHeaders;
+    }
+
+    public void setCopyHeaders(boolean copyHeaders) {
+        this.copyHeaders = copyHeaders;
+    }
+
+    public boolean isSkipRequestHeaders() {
+        return skipRequestHeaders;
+    }
+
+    public void setSkipRequestHeaders(boolean skipRequestHeaders) {
+        this.skipRequestHeaders = skipRequestHeaders;
+    }
+
+    public boolean isSkipResponseHeaders() {
+        return skipResponseHeaders;
+    }
+
+    public void setSkipResponseHeaders(boolean skipResponseHeaders) {
+        this.skipResponseHeaders = skipResponseHeaders;
+    }
+
     @Override
     public void doStart() throws Exception {
         super.doStart();
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
index 2ddb4c6..6ccea0f 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
@@ -137,12 +137,12 @@ public class HttpEndpoint extends HttpCommonEndpoint {
     @UriParam(label = "producer", description = "To use custom host header for producer. When not set in query will "
                                                 + "be ignored. When set will override host header derived from url.")
     private String customHostHeader;
-    @UriParam(label = "producer.advanced",
+    @UriParam(label = "producer,advanced",
               description = "Whether to skip mapping all the Camel headers as HTTP request headers."
                             + " If there are no data from Camel headers needed to be included in the HTTP request then this can avoid"
                             + " parsing overhead with many object allocations for the JVM garbage collector.")
     private boolean skipRequestHeaders;
-    @UriParam(label = "producer.advanced",
+    @UriParam(label = "producer,advanced",
               description = "Whether to skip mapping all the HTTP response headers to Camel headers."
                             + " If there are no data needed from HTTP headers then this can avoid parsing overhead"
                             + " with many object allocations for the JVM garbage collector.")
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HttpComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HttpComponentBuilderFactory.java
index baed693..366c2b6 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HttpComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HttpComponentBuilderFactory.java
@@ -69,6 +69,24 @@ public interface HttpComponentBuilderFactory {
             return this;
         }
         /**
+         * If this option is true then IN exchange headers will be copied to OUT
+         * exchange headers according to copy strategy. Setting this to false,
+         * allows to only include the headers from the HTTP response (not
+         * propagating IN headers).
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: true
+         * Group: producer
+         * 
+         * @param copyHeaders the value to set
+         * @return the dsl builder
+         */
+        default HttpComponentBuilder copyHeaders(boolean copyHeaders) {
+            doSetProperty("copyHeaders", copyHeaders);
+            return this;
+        }
+        /**
          * Whether the producer should be started lazy (on the first message).
          * By starting lazy you can use this to allow CamelContext and routes to
          * startup in situations where a producer may otherwise fail during
@@ -110,6 +128,44 @@ public interface HttpComponentBuilderFactory {
             return this;
         }
         /**
+         * Whether to skip mapping all the Camel headers as HTTP request
+         * headers. If there are no data from Camel headers needed to be
+         * included in the HTTP request then this can avoid parsing overhead
+         * with many object allocations for the JVM garbage collector.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: producer (advanced)
+         * 
+         * @param skipRequestHeaders the value to set
+         * @return the dsl builder
+         */
+        default HttpComponentBuilder skipRequestHeaders(
+                boolean skipRequestHeaders) {
+            doSetProperty("skipRequestHeaders", skipRequestHeaders);
+            return this;
+        }
+        /**
+         * Whether to skip mapping all the HTTP response headers to Camel
+         * headers. If there are no data needed from HTTP headers then this can
+         * avoid parsing overhead with many object allocations for the JVM
+         * garbage collector.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: producer (advanced)
+         * 
+         * @param skipResponseHeaders the value to set
+         * @return the dsl builder
+         */
+        default HttpComponentBuilder skipResponseHeaders(
+                boolean skipResponseHeaders) {
+            doSetProperty("skipResponseHeaders", skipResponseHeaders);
+            return this;
+        }
+        /**
          * Whether to allow java serialization when a request uses
          * context-type=application/x-java-serialized-object. This is by default
          * turned off. If you enable this then be aware that Java will
@@ -646,8 +702,11 @@ public interface HttpComponentBuilderFactory {
                 Object value) {
             switch (name) {
             case "cookieStore": ((HttpComponent) component).setCookieStore((org.apache.http.client.CookieStore) value); return true;
+            case "copyHeaders": ((HttpComponent) component).setCopyHeaders((boolean) value); return true;
             case "lazyStartProducer": ((HttpComponent) component).setLazyStartProducer((boolean) value); return true;
             case "responsePayloadStreamingThreshold": ((HttpComponent) component).setResponsePayloadStreamingThreshold((int) value); return true;
+            case "skipRequestHeaders": ((HttpComponent) component).setSkipRequestHeaders((boolean) value); return true;
+            case "skipResponseHeaders": ((HttpComponent) component).setSkipResponseHeaders((boolean) value); return true;
             case "allowJavaSerializedObject": ((HttpComponent) component).setAllowJavaSerializedObject((boolean) value); return true;
             case "authCachingDisabled": ((HttpComponent) component).setAuthCachingDisabled((boolean) value); return true;
             case "automaticRetriesDisabled": ((HttpComponent) component).setAutomaticRetriesDisabled((boolean) value); return true;
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HttpsComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HttpsComponentBuilderFactory.java
index 333d3a5..2cce9583 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HttpsComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HttpsComponentBuilderFactory.java
@@ -69,6 +69,24 @@ public interface HttpsComponentBuilderFactory {
             return this;
         }
         /**
+         * If this option is true then IN exchange headers will be copied to OUT
+         * exchange headers according to copy strategy. Setting this to false,
+         * allows to only include the headers from the HTTP response (not
+         * propagating IN headers).
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: true
+         * Group: producer
+         * 
+         * @param copyHeaders the value to set
+         * @return the dsl builder
+         */
+        default HttpsComponentBuilder copyHeaders(boolean copyHeaders) {
+            doSetProperty("copyHeaders", copyHeaders);
+            return this;
+        }
+        /**
          * Whether the producer should be started lazy (on the first message).
          * By starting lazy you can use this to allow CamelContext and routes to
          * startup in situations where a producer may otherwise fail during
@@ -111,6 +129,44 @@ public interface HttpsComponentBuilderFactory {
             return this;
         }
         /**
+         * Whether to skip mapping all the Camel headers as HTTP request
+         * headers. If there are no data from Camel headers needed to be
+         * included in the HTTP request then this can avoid parsing overhead
+         * with many object allocations for the JVM garbage collector.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: producer (advanced)
+         * 
+         * @param skipRequestHeaders the value to set
+         * @return the dsl builder
+         */
+        default HttpsComponentBuilder skipRequestHeaders(
+                boolean skipRequestHeaders) {
+            doSetProperty("skipRequestHeaders", skipRequestHeaders);
+            return this;
+        }
+        /**
+         * Whether to skip mapping all the HTTP response headers to Camel
+         * headers. If there are no data needed from HTTP headers then this can
+         * avoid parsing overhead with many object allocations for the JVM
+         * garbage collector.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: producer (advanced)
+         * 
+         * @param skipResponseHeaders the value to set
+         * @return the dsl builder
+         */
+        default HttpsComponentBuilder skipResponseHeaders(
+                boolean skipResponseHeaders) {
+            doSetProperty("skipResponseHeaders", skipResponseHeaders);
+            return this;
+        }
+        /**
          * Whether to allow java serialization when a request uses
          * context-type=application/x-java-serialized-object. This is by default
          * turned off. If you enable this then be aware that Java will
@@ -649,8 +705,11 @@ public interface HttpsComponentBuilderFactory {
                 Object value) {
             switch (name) {
             case "cookieStore": ((HttpComponent) component).setCookieStore((org.apache.http.client.CookieStore) value); return true;
+            case "copyHeaders": ((HttpComponent) component).setCopyHeaders((boolean) value); return true;
             case "lazyStartProducer": ((HttpComponent) component).setLazyStartProducer((boolean) value); return true;
             case "responsePayloadStreamingThreshold": ((HttpComponent) component).setResponsePayloadStreamingThreshold((int) value); return true;
+            case "skipRequestHeaders": ((HttpComponent) component).setSkipRequestHeaders((boolean) value); return true;
+            case "skipResponseHeaders": ((HttpComponent) component).setSkipResponseHeaders((boolean) value); return true;
             case "allowJavaSerializedObject": ((HttpComponent) component).setAllowJavaSerializedObject((boolean) value); return true;
             case "authCachingDisabled": ((HttpComponent) component).setAuthCachingDisabled((boolean) value); return true;
             case "automaticRetriesDisabled": ((HttpComponent) component).setAutomaticRetriesDisabled((boolean) value); return true;
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java
index d3e0b1e..f5989f1 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java
@@ -1142,6 +1142,84 @@ public interface HttpEndpointBuilderFactory {
             return this;
         }
         /**
+         * Whether to skip mapping all the Camel headers as HTTP request
+         * headers. If there are no data from Camel headers needed to be
+         * included in the HTTP request then this can avoid parsing overhead
+         * with many object allocations for the JVM garbage collector.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: producer (advanced)
+         * 
+         * @param skipRequestHeaders the value to set
+         * @return the dsl builder
+         */
+        default AdvancedHttpEndpointBuilder skipRequestHeaders(
+                boolean skipRequestHeaders) {
+            doSetProperty("skipRequestHeaders", skipRequestHeaders);
+            return this;
+        }
+        /**
+         * Whether to skip mapping all the Camel headers as HTTP request
+         * headers. If there are no data from Camel headers needed to be
+         * included in the HTTP request then this can avoid parsing overhead
+         * with many object allocations for the JVM garbage collector.
+         * 
+         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
+         * type.
+         * 
+         * Default: false
+         * Group: producer (advanced)
+         * 
+         * @param skipRequestHeaders the value to set
+         * @return the dsl builder
+         */
+        default AdvancedHttpEndpointBuilder skipRequestHeaders(
+                String skipRequestHeaders) {
+            doSetProperty("skipRequestHeaders", skipRequestHeaders);
+            return this;
+        }
+        /**
+         * Whether to skip mapping all the HTTP response headers to Camel
+         * headers. If there are no data needed from HTTP headers then this can
+         * avoid parsing overhead with many object allocations for the JVM
+         * garbage collector.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: producer (advanced)
+         * 
+         * @param skipResponseHeaders the value to set
+         * @return the dsl builder
+         */
+        default AdvancedHttpEndpointBuilder skipResponseHeaders(
+                boolean skipResponseHeaders) {
+            doSetProperty("skipResponseHeaders", skipResponseHeaders);
+            return this;
+        }
+        /**
+         * Whether to skip mapping all the HTTP response headers to Camel
+         * headers. If there are no data needed from HTTP headers then this can
+         * avoid parsing overhead with many object allocations for the JVM
+         * garbage collector.
+         * 
+         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
+         * type.
+         * 
+         * Default: false
+         * Group: producer (advanced)
+         * 
+         * @param skipResponseHeaders the value to set
+         * @return the dsl builder
+         */
+        default AdvancedHttpEndpointBuilder skipResponseHeaders(
+                String skipResponseHeaders) {
+            doSetProperty("skipResponseHeaders", skipResponseHeaders);
+            return this;
+        }
+        /**
          * Provide access to the http client request parameters used on new
          * RequestConfig instances used by producers or consumers of this
          * endpoint.
@@ -1439,84 +1517,6 @@ public interface HttpEndpointBuilderFactory {
             doSetProperty("useSystemProperties", useSystemProperties);
             return this;
         }
-        /**
-         * Whether to skip mapping all the Camel headers as HTTP request
-         * headers. If there are no data from Camel headers needed to be
-         * included in the HTTP request then this can avoid parsing overhead
-         * with many object allocations for the JVM garbage collector.
-         * 
-         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
-         * 
-         * Default: false
-         * Group: producer.advanced
-         * 
-         * @param skipRequestHeaders the value to set
-         * @return the dsl builder
-         */
-        default AdvancedHttpEndpointBuilder skipRequestHeaders(
-                boolean skipRequestHeaders) {
-            doSetProperty("skipRequestHeaders", skipRequestHeaders);
-            return this;
-        }
-        /**
-         * Whether to skip mapping all the Camel headers as HTTP request
-         * headers. If there are no data from Camel headers needed to be
-         * included in the HTTP request then this can avoid parsing overhead
-         * with many object allocations for the JVM garbage collector.
-         * 
-         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
-         * type.
-         * 
-         * Default: false
-         * Group: producer.advanced
-         * 
-         * @param skipRequestHeaders the value to set
-         * @return the dsl builder
-         */
-        default AdvancedHttpEndpointBuilder skipRequestHeaders(
-                String skipRequestHeaders) {
-            doSetProperty("skipRequestHeaders", skipRequestHeaders);
-            return this;
-        }
-        /**
-         * Whether to skip mapping all the HTTP response headers to Camel
-         * headers. If there are no data needed from HTTP headers then this can
-         * avoid parsing overhead with many object allocations for the JVM
-         * garbage collector.
-         * 
-         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
-         * 
-         * Default: false
-         * Group: producer.advanced
-         * 
-         * @param skipResponseHeaders the value to set
-         * @return the dsl builder
-         */
-        default AdvancedHttpEndpointBuilder skipResponseHeaders(
-                boolean skipResponseHeaders) {
-            doSetProperty("skipResponseHeaders", skipResponseHeaders);
-            return this;
-        }
-        /**
-         * Whether to skip mapping all the HTTP response headers to Camel
-         * headers. If there are no data needed from HTTP headers then this can
-         * avoid parsing overhead with many object allocations for the JVM
-         * garbage collector.
-         * 
-         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
-         * type.
-         * 
-         * Default: false
-         * Group: producer.advanced
-         * 
-         * @param skipResponseHeaders the value to set
-         * @return the dsl builder
-         */
-        default AdvancedHttpEndpointBuilder skipResponseHeaders(
-                String skipResponseHeaders) {
-            doSetProperty("skipResponseHeaders", skipResponseHeaders);
-            return this;
-        }
     }
 
     /**
diff --git a/docs/components/modules/ROOT/pages/http-component.adoc b/docs/components/modules/ROOT/pages/http-component.adoc
index e9e0a90..a939887 100644
--- a/docs/components/modules/ROOT/pages/http-component.adoc
+++ b/docs/components/modules/ROOT/pages/http-component.adoc
@@ -56,7 +56,7 @@ route, use the xref:jetty-component.adoc[Jetty Component] instead.
 
 
 // component options: START
-The HTTP component supports 34 options, which are listed below.
+The HTTP component supports 37 options, which are listed below.
 
 
 
@@ -64,8 +64,11 @@ The HTTP component supports 34 options, which are listed below.
 |===
 | Name | Description | Default | Type
 | *cookieStore* (producer) | To use a custom org.apache.http.client.CookieStore. By default the org.apache.http.impl.client.BasicCookieStore is used which is an in-memory only cookie store. Notice if bridgeEndpoint=true then the cookie store is forced to be a noop cookie store as cookie shouldn't be stored as we are just bridging (eg acting as a proxy). |  | CookieStore
+| *copyHeaders* (producer) | If this option is true then IN exchange headers will be copied to OUT exchange headers according to copy strategy. Setting this to false, allows to only include the headers from the HTTP response (not propagating IN headers). | true | boolean
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *responsePayloadStreaming{zwsp}Threshold* (producer) | This threshold in bytes controls whether the response payload should be stored in memory as a byte array or be streaming based. Set this to -1 to always use streaming mode. | 8192 | int
+| *skipRequestHeaders* (producer) | Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
+| *skipResponseHeaders* (producer) | Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *allowJavaSerializedObject* (advanced) | Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object. This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk. | false | boolean
 | *authCachingDisabled* (advanced) | Disables authentication scheme caching | false | boolean
 | *automaticRetriesDisabled* (advanced) | Disables automatic request recovery and re-execution | false | boolean
@@ -154,6 +157,8 @@ with the following path and query parameters:
 | *deleteWithBody* (producer) | Whether the HTTP DELETE should include the message body or not. By default HTTP DELETE do not include any HTTP body. However in some rare cases users may need to be able to include the message body. | false | boolean
 | *getWithBody* (producer) | Whether the HTTP GET should include the message body or not. By default HTTP GET do not include any HTTP body. However in some rare cases users may need to be able to include the message body. | false | boolean
 | *okStatusCodeRange* (producer) | The status codes which are considered a success response. The values are inclusive. Multiple ranges can be defined, separated by comma, e.g. 200-204,209,301-304. Each range must be a single number or from-to with the dash included. | 200-299 | String
+| *skipRequestHeaders* (producer) | Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
+| *skipResponseHeaders* (producer) | Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *clientBuilder* (advanced) | Provide access to the http client request parameters used on new RequestConfig instances used by producers or consumers of this endpoint. |  | HttpClientBuilder
 | *clientConnectionManager* (advanced) | To use a custom HttpClientConnectionManager to manage connections |  | HttpClientConnectionManager
 | *connectionsPerRoute* (advanced) | The maximum number of connections per route. | 20 | int
@@ -163,8 +168,6 @@ with the following path and query parameters:
 | *httpContext* (advanced) | To use a custom HttpContext instance |  | HttpContext
 | *maxTotalConnections* (advanced) | The maximum number of connections. | 200 | int
 | *useSystemProperties* (advanced) | To use System Properties as fallback for configuration | false | boolean
-| *skipRequestHeaders* (producer.advanced) | Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
-| *skipResponseHeaders* (producer.advanced) | Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *proxyAuthDomain* (proxy) | Proxy authentication domain to use with NTML |  | String
 | *proxyAuthHost* (proxy) | Proxy authentication host |  | String
 | *proxyAuthMethod* (proxy) | Proxy authentication method to use. There are 3 enums and the value can be one of: Basic, Digest, NTLM |  | String


[camel] 02/06: CAMEL-16264: camel-http - Add option to ignore response headers

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 30e9be4b31b6e4c00857ad5c631766fc876134ae
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Feb 26 07:04:41 2021 +0100

    CAMEL-16264: camel-http - Add option to ignore response headers
---
 .../apache/camel/catalog/docs/http-component.adoc  |  3 +-
 .../component/http/HttpEndpointConfigurer.java     |  6 +++
 .../component/http/HttpEndpointUriFactory.java     |  3 +-
 .../org/apache/camel/component/http/http.json      |  1 +
 .../org/apache/camel/component/http/https.json     |  1 +
 .../camel-http/src/main/docs/http-component.adoc   |  3 +-
 .../apache/camel/component/http/HttpEndpoint.java  | 16 ++++++
 .../apache/camel/component/http/HttpProducer.java  | 58 ++++++++++++----------
 .../endpoint/dsl/HttpEndpointBuilderFactory.java   | 39 +++++++++++++++
 .../modules/ROOT/pages/http-component.adoc         |  3 +-
 10 files changed, 102 insertions(+), 31 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/http-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/http-component.adoc
index cc642c4..61d5f5f 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/http-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/http-component.adoc
@@ -126,7 +126,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (48 parameters):
+=== Query Parameters (49 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -161,6 +161,7 @@ with the following path and query parameters:
 | *httpContext* (advanced) | To use a custom HttpContext instance |  | HttpContext
 | *maxTotalConnections* (advanced) | The maximum number of connections. | 200 | int
 | *useSystemProperties* (advanced) | To use System Properties as fallback for configuration | false | boolean
+| *skipResponseHeaders* (producer.advanced) | Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *proxyAuthDomain* (proxy) | Proxy authentication domain to use with NTML |  | String
 | *proxyAuthHost* (proxy) | Proxy authentication host |  | String
 | *proxyAuthMethod* (proxy) | Proxy authentication method to use. There are 3 enums and the value can be one of: Basic, Digest, NTLM |  | String
diff --git a/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointConfigurer.java b/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointConfigurer.java
index 61e9b9b..237aa97 100644
--- a/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointConfigurer.java
+++ b/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointConfigurer.java
@@ -106,6 +106,8 @@ public class HttpEndpointConfigurer extends PropertyConfigurerSupport implements
         case "proxyHost": target.setProxyHost(property(camelContext, java.lang.String.class, value)); return true;
         case "proxyport":
         case "proxyPort": target.setProxyPort(property(camelContext, int.class, value)); return true;
+        case "skipresponseheaders":
+        case "skipResponseHeaders": target.setSkipResponseHeaders(property(camelContext, boolean.class, value)); return true;
         case "sslcontextparameters":
         case "sslContextParameters": target.setSslContextParameters(property(camelContext, org.apache.camel.support.jsse.SSLContextParameters.class, value)); return true;
         case "throwexceptiononfailure":
@@ -208,6 +210,8 @@ public class HttpEndpointConfigurer extends PropertyConfigurerSupport implements
         case "proxyHost": return java.lang.String.class;
         case "proxyport":
         case "proxyPort": return int.class;
+        case "skipresponseheaders":
+        case "skipResponseHeaders": return boolean.class;
         case "sslcontextparameters":
         case "sslContextParameters": return org.apache.camel.support.jsse.SSLContextParameters.class;
         case "throwexceptiononfailure":
@@ -311,6 +315,8 @@ public class HttpEndpointConfigurer extends PropertyConfigurerSupport implements
         case "proxyHost": return target.getProxyHost();
         case "proxyport":
         case "proxyPort": return target.getProxyPort();
+        case "skipresponseheaders":
+        case "skipResponseHeaders": return target.isSkipResponseHeaders();
         case "sslcontextparameters":
         case "sslContextParameters": return target.getSslContextParameters();
         case "throwexceptiononfailure":
diff --git a/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointUriFactory.java b/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointUriFactory.java
index 8d2ce0c..9b247bd 100644
--- a/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointUriFactory.java
+++ b/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointUriFactory.java
@@ -21,7 +21,7 @@ public class HttpEndpointUriFactory extends org.apache.camel.support.component.E
     private static final Set<String> PROPERTY_NAMES;
     private static final Set<String> SECRET_PROPERTY_NAMES;
     static {
-        Set<String> props = new HashSet<>(49);
+        Set<String> props = new HashSet<>(50);
         props.add("clientBuilder");
         props.add("authMethodPriority");
         props.add("ignoreResponseBody");
@@ -54,6 +54,7 @@ public class HttpEndpointUriFactory extends org.apache.camel.support.component.E
         props.add("proxyAuthScheme");
         props.add("sslContextParameters");
         props.add("httpMethod");
+        props.add("skipResponseHeaders");
         props.add("deleteWithBody");
         props.add("httpUri");
         props.add("headerFilterStrategy");
diff --git a/components/camel-http/src/generated/resources/org/apache/camel/component/http/http.json b/components/camel-http/src/generated/resources/org/apache/camel/component/http/http.json
index 10af0bc..fc55d55 100644
--- a/components/camel-http/src/generated/resources/org/apache/camel/component/http/http.json
+++ b/components/camel-http/src/generated/resources/org/apache/camel/component/http/http.json
@@ -90,6 +90,7 @@
     "httpContext": { "kind": "parameter", "displayName": "Http Context", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.protocol.HttpContext", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom HttpContext instance" },
     "maxTotalConnections": { "kind": "parameter", "displayName": "Max Total Connections", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 200, "description": "The maximum number of connections." },
     "useSystemProperties": { "kind": "parameter", "displayName": "Use System Properties", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To use System Properties as fallback for configuration" },
+    "skipResponseHeaders": { "kind": "parameter", "displayName": "Skip Response Headers", "group": "producer.advanced", "label": "producer.advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations  [...]
     "proxyAuthDomain": { "kind": "parameter", "displayName": "Proxy Auth Domain", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication domain to use with NTML" },
     "proxyAuthHost": { "kind": "parameter", "displayName": "Proxy Auth Host", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication host" },
     "proxyAuthMethod": { "kind": "parameter", "displayName": "Proxy Auth Method", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "Basic", "Digest", "NTLM" ], "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication method to use" },
diff --git a/components/camel-http/src/generated/resources/org/apache/camel/component/http/https.json b/components/camel-http/src/generated/resources/org/apache/camel/component/http/https.json
index f109756..b2e1527 100644
--- a/components/camel-http/src/generated/resources/org/apache/camel/component/http/https.json
+++ b/components/camel-http/src/generated/resources/org/apache/camel/component/http/https.json
@@ -90,6 +90,7 @@
     "httpContext": { "kind": "parameter", "displayName": "Http Context", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.protocol.HttpContext", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom HttpContext instance" },
     "maxTotalConnections": { "kind": "parameter", "displayName": "Max Total Connections", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 200, "description": "The maximum number of connections." },
     "useSystemProperties": { "kind": "parameter", "displayName": "Use System Properties", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To use System Properties as fallback for configuration" },
+    "skipResponseHeaders": { "kind": "parameter", "displayName": "Skip Response Headers", "group": "producer.advanced", "label": "producer.advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations  [...]
     "proxyAuthDomain": { "kind": "parameter", "displayName": "Proxy Auth Domain", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication domain to use with NTML" },
     "proxyAuthHost": { "kind": "parameter", "displayName": "Proxy Auth Host", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication host" },
     "proxyAuthMethod": { "kind": "parameter", "displayName": "Proxy Auth Method", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "Basic", "Digest", "NTLM" ], "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication method to use" },
diff --git a/components/camel-http/src/main/docs/http-component.adoc b/components/camel-http/src/main/docs/http-component.adoc
index cc642c4..61d5f5f 100644
--- a/components/camel-http/src/main/docs/http-component.adoc
+++ b/components/camel-http/src/main/docs/http-component.adoc
@@ -126,7 +126,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (48 parameters):
+=== Query Parameters (49 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -161,6 +161,7 @@ with the following path and query parameters:
 | *httpContext* (advanced) | To use a custom HttpContext instance |  | HttpContext
 | *maxTotalConnections* (advanced) | The maximum number of connections. | 200 | int
 | *useSystemProperties* (advanced) | To use System Properties as fallback for configuration | false | boolean
+| *skipResponseHeaders* (producer.advanced) | Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *proxyAuthDomain* (proxy) | Proxy authentication domain to use with NTML |  | String
 | *proxyAuthHost* (proxy) | Proxy authentication host |  | String
 | *proxyAuthMethod* (proxy) | Proxy authentication method to use. There are 3 enums and the value can be one of: Basic, Digest, NTLM |  | String
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
index 5783ec4..52e6c42 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
@@ -137,6 +137,10 @@ public class HttpEndpoint extends HttpCommonEndpoint {
     @UriParam(label = "producer", description = "To use custom host header for producer. When not set in query will "
                                                 + "be ignored. When set will override host header derived from url.")
     private String customHostHeader;
+    @UriParam(label = "producer.advanced",
+              description = "Whether to skip mapping all the HTTP response headers to Camel headers."
+                            + " If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector.")
+    private boolean skipResponseHeaders;
 
     public HttpEndpoint() {
     }
@@ -533,6 +537,18 @@ public class HttpEndpoint extends HttpCommonEndpoint {
         return customHostHeader;
     }
 
+    public boolean isSkipResponseHeaders() {
+        return skipResponseHeaders;
+    }
+
+    /**
+     * Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP
+     * headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector.
+     */
+    public void setSkipResponseHeaders(boolean skipResponseHeaders) {
+        this.skipResponseHeaders = skipResponseHeaders;
+    }
+
     @ManagedAttribute(description = "Maximum number of allowed persistent connections")
     public int getClientConnectionsPoolStatsMax() {
         ConnPoolControl<?> pool = null;
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
index b789c40..4b6497d 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
@@ -321,37 +321,41 @@ public class HttpProducer extends DefaultProducer {
         }
         answer.setBody(response);
 
-        // propagate HTTP response headers
-        Map<String, List<String>> cookieHeaders = null;
-        if (getEndpoint().getCookieHandler() != null) {
-            cookieHeaders = new HashMap<>();
-        }
-
-        // optimize to walk headers with an iterator which does not create a new array as getAllHeaders does
-        boolean found = false;
-        HeaderIterator it = httpResponse.headerIterator();
-        while (it.hasNext()) {
-            Header header = it.nextHeader();
-            String name = header.getName();
-            String value = header.getValue();
-            if (cookieHeaders != null) {
-                cookieHeaders.computeIfAbsent(name, k -> new ArrayList<>()).add(value);
+        if (!getEndpoint().isSkipResponseHeaders()) {
+
+            // propagate HTTP response headers
+            Map<String, List<String>> cookieHeaders = null;
+            if (getEndpoint().getCookieHandler() != null) {
+                cookieHeaders = new HashMap<>();
             }
-            if (!found && name.equalsIgnoreCase("content-type")) {
-                name = Exchange.CONTENT_TYPE;
-                exchange.setProperty(Exchange.CHARSET_NAME, IOHelper.getCharsetNameFromContentType(value));
-                found = true;
+
+            // optimize to walk headers with an iterator which does not create a new array as getAllHeaders does
+            boolean found = false;
+            HeaderIterator it = httpResponse.headerIterator();
+            while (it.hasNext()) {
+                Header header = it.nextHeader();
+                String name = header.getName();
+                String value = header.getValue();
+                if (cookieHeaders != null) {
+                    cookieHeaders.computeIfAbsent(name, k -> new ArrayList<>()).add(value);
+                }
+                if (!found && name.equalsIgnoreCase("content-type")) {
+                    name = Exchange.CONTENT_TYPE;
+                    exchange.setProperty(Exchange.CHARSET_NAME, IOHelper.getCharsetNameFromContentType(value));
+                    found = true;
+                }
+                // use http helper to extract parameter value as it may contain multiple values
+                Object extracted = HttpHelper.extractHttpParameterValue(value);
+                if (strategy != null && !strategy.applyFilterToExternalHeaders(name, extracted, exchange)) {
+                    HttpHelper.appendHeader(answer.getHeaders(), name, extracted);
+                }
             }
-            // use http helper to extract parameter value as it may contain multiple values
-            Object extracted = HttpHelper.extractHttpParameterValue(value);
-            if (strategy != null && !strategy.applyFilterToExternalHeaders(name, extracted, exchange)) {
-                HttpHelper.appendHeader(answer.getHeaders(), name, extracted);
+            // handle cookies
+            if (getEndpoint().getCookieHandler() != null) {
+                getEndpoint().getCookieHandler().storeCookies(exchange, httpRequest.getURI(), cookieHeaders);
             }
         }
-        // handle cookies
-        if (getEndpoint().getCookieHandler() != null) {
-            getEndpoint().getCookieHandler().storeCookies(exchange, httpRequest.getURI(), cookieHeaders);
-        }
+
         // endpoint might be configured to copy headers from in to out
         // to avoid overriding existing headers with old values just
         // filter the http protocol headers
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java
index 0816bd8..2561783 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java
@@ -1439,6 +1439,45 @@ public interface HttpEndpointBuilderFactory {
             doSetProperty("useSystemProperties", useSystemProperties);
             return this;
         }
+        /**
+         * Whether to skip mapping all the HTTP response headers to Camel
+         * headers. If there are no data needed from HTTP headers then this can
+         * avoid parsing overhead with many object allocations for the JVM
+         * garbage collector.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: producer.advanced
+         * 
+         * @param skipResponseHeaders the value to set
+         * @return the dsl builder
+         */
+        default AdvancedHttpEndpointBuilder skipResponseHeaders(
+                boolean skipResponseHeaders) {
+            doSetProperty("skipResponseHeaders", skipResponseHeaders);
+            return this;
+        }
+        /**
+         * Whether to skip mapping all the HTTP response headers to Camel
+         * headers. If there are no data needed from HTTP headers then this can
+         * avoid parsing overhead with many object allocations for the JVM
+         * garbage collector.
+         * 
+         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
+         * type.
+         * 
+         * Default: false
+         * Group: producer.advanced
+         * 
+         * @param skipResponseHeaders the value to set
+         * @return the dsl builder
+         */
+        default AdvancedHttpEndpointBuilder skipResponseHeaders(
+                String skipResponseHeaders) {
+            doSetProperty("skipResponseHeaders", skipResponseHeaders);
+            return this;
+        }
     }
 
     /**
diff --git a/docs/components/modules/ROOT/pages/http-component.adoc b/docs/components/modules/ROOT/pages/http-component.adoc
index 6274022..3d3f2a6 100644
--- a/docs/components/modules/ROOT/pages/http-component.adoc
+++ b/docs/components/modules/ROOT/pages/http-component.adoc
@@ -128,7 +128,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (48 parameters):
+=== Query Parameters (49 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -163,6 +163,7 @@ with the following path and query parameters:
 | *httpContext* (advanced) | To use a custom HttpContext instance |  | HttpContext
 | *maxTotalConnections* (advanced) | The maximum number of connections. | 200 | int
 | *useSystemProperties* (advanced) | To use System Properties as fallback for configuration | false | boolean
+| *skipResponseHeaders* (producer.advanced) | Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *proxyAuthDomain* (proxy) | Proxy authentication domain to use with NTML |  | String
 | *proxyAuthHost* (proxy) | Proxy authentication host |  | String
 | *proxyAuthMethod* (proxy) | Proxy authentication method to use. There are 3 enums and the value can be one of: Basic, Digest, NTLM |  | String


[camel] 03/06: camel-http - Optimize a bit

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 a5068fdd877f070d80aaf1fa5e8409c2d6ac4db4
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Feb 26 07:20:30 2021 +0100

    camel-http - Optimize a bit
---
 .../component/http/HttpDeleteWithBodyMethod.java   |  5 +++++
 .../component/http/HttpGetWithBodyMethod.java      |  5 +++++
 .../apache/camel/component/http/HttpMethods.java   | 25 ++++++++++++++++++++++
 .../apache/camel/component/http/HttpProducer.java  | 21 ++++++++++--------
 4 files changed, 47 insertions(+), 9 deletions(-)

diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpDeleteWithBodyMethod.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpDeleteWithBodyMethod.java
index d8a37d9..5c30f35 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpDeleteWithBodyMethod.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpDeleteWithBodyMethod.java
@@ -30,6 +30,11 @@ public class HttpDeleteWithBodyMethod extends HttpEntityEnclosingRequestBase {
         setEntity(entity);
     }
 
+    public HttpDeleteWithBodyMethod(URI uri, HttpEntity entity) {
+        setURI(uri);
+        setEntity(entity);
+    }
+
     @Override
     public String getMethod() {
         return METHOD_NAME;
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpGetWithBodyMethod.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpGetWithBodyMethod.java
index 47aa477..efa7cb5 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpGetWithBodyMethod.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpGetWithBodyMethod.java
@@ -30,6 +30,11 @@ public class HttpGetWithBodyMethod extends HttpEntityEnclosingRequestBase {
         setEntity(entity);
     }
 
+    public HttpGetWithBodyMethod(URI uri, HttpEntity entity) {
+        setURI(uri);
+        setEntity(entity);
+    }
+
     @Override
     public String getMethod() {
         return METHOD_NAME;
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpMethods.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpMethods.java
index d57f84c..22fff8a 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpMethods.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpMethods.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.http;
 
+import java.net.URI;
+
 import org.apache.camel.Exchange;
 import org.apache.camel.Expression;
 import org.apache.camel.builder.ExpressionBuilder;
@@ -70,6 +72,29 @@ public enum HttpMethods implements Expression {
         }
     }
 
+    public HttpRequestBase createMethod(final URI uri) {
+        switch (this) {
+            case GET:
+                return new HttpGet(uri);
+            case PATCH:
+                return new HttpPatch(uri);
+            case POST:
+                return new HttpPost(uri);
+            case PUT:
+                return new HttpPut(uri);
+            case DELETE:
+                return new HttpDelete(uri);
+            case HEAD:
+                return new HttpHead(uri);
+            case OPTIONS:
+                return new HttpOptions(uri);
+            case TRACE:
+                return new HttpTrace(uri);
+            default:
+                throw new RuntimeException("no such method " + this);
+        }
+    }
+
     public final boolean isEntityEnclosing() {
         return entity;
     }
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
index 4b6497d..e1869eb 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
@@ -85,13 +85,14 @@ public class HttpProducer extends DefaultProducer {
     private static final Logger LOG = LoggerFactory.getLogger(HttpProducer.class);
 
     private HttpClient httpClient;
-    private HttpContext httpContext;
-    private boolean throwException;
-    private boolean transferException;
-    private HeaderFilterStrategy httpProtocolHeaderFilterStrategy = new HttpProtocolHeaderFilterStrategy();
+    private final HttpContext httpContext;
+    private final boolean throwException;
+    private final boolean transferException;
+    private final HeaderFilterStrategy httpProtocolHeaderFilterStrategy = new HttpProtocolHeaderFilterStrategy();
     private int minOkRange;
     private int maxOkRange;
     private String defaultUrl;
+    private URI defaultUri;
 
     public HttpProducer(HttpEndpoint endpoint) {
         super(endpoint);
@@ -124,6 +125,7 @@ public class HttpProducer extends DefaultProducer {
             queryString = UnsafeUriCharactersEncoder.encodeHttpURI(queryString);
             uri = URISupport.createURIWithQuery(uri, queryString);
         }
+        defaultUri = uri;
         defaultUrl = uri.toASCIIString();
     }
 
@@ -539,10 +541,11 @@ public class HttpProducer extends DefaultProducer {
      * @throws Exception          is thrown if error creating RequestEntity
      */
     protected HttpRequestBase createMethod(Exchange exchange) throws Exception {
-        if (defaultUrl == null) {
+        if (defaultUri == null || defaultUrl == null) {
             throw new IllegalArgumentException("Producer must be started");
         }
         String url = defaultUrl;
+        URI uri = defaultUri;
 
         // the exchange can have some headers that override the default url and forces to create
         // a new url that is dynamic based on header values
@@ -565,22 +568,22 @@ public class HttpProducer extends DefaultProducer {
         if (create) {
             // creating the url to use takes 2-steps
             url = HttpHelper.createURL(exchange, getEndpoint());
-            URI uri = HttpHelper.createURI(exchange, url, getEndpoint());
+            uri = HttpHelper.createURI(exchange, url, getEndpoint());
             // get the url from the uri
             url = uri.toASCIIString();
         }
 
         // create http holder objects for the request
         HttpMethods methodToUse = HttpMethodHelper.createMethod(exchange, getEndpoint());
-        HttpRequestBase method = methodToUse.createMethod(url);
+        HttpRequestBase method = methodToUse.createMethod(uri);
 
         // special for HTTP DELETE/GET if the message body should be included
         if (getEndpoint().isDeleteWithBody() && "DELETE".equals(method.getMethod())) {
             HttpEntity requestEntity = createRequestEntity(exchange);
-            method = new HttpDeleteWithBodyMethod(url, requestEntity);
+            method = new HttpDeleteWithBodyMethod(uri, requestEntity);
         } else if (getEndpoint().isGetWithBody() && "GET".equals(method.getMethod())) {
             HttpEntity requestEntity = createRequestEntity(exchange);
-            method = new HttpGetWithBodyMethod(url, requestEntity);
+            method = new HttpGetWithBodyMethod(uri, requestEntity);
         }
 
         LOG.trace("Using URL: {} with method: {}", url, method);


[camel] 06/06: CAMEL-16264: camel-http - Allow to configure these on component level.

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 1597870ff6ee305330cf165b476ea46256a44f53
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Feb 26 07:47:08 2021 +0100

    CAMEL-16264: camel-http - Allow to configure these on component level.
---
 .../apache/camel/component/http/HttpComponent.java   | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
index 4b4ef65..591add7 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
@@ -153,35 +153,35 @@ public class HttpComponent extends HttpCommonComponent implements RestProducerFa
                             + " should be stored in memory as a byte array or be streaming based. Set this to -1 to always use streaming mode.")
     protected int responsePayloadStreamingThreshold = 8192;
     @Metadata(label = "advanced", description = "Disables automatic redirect handling")
-    private boolean redirectHandlingDisabled;
+    protected boolean redirectHandlingDisabled;
     @Metadata(label = "advanced", description = "Disables automatic request recovery and re-execution")
-    private boolean automaticRetriesDisabled;
+    protected boolean automaticRetriesDisabled;
     @Metadata(label = "advanced", description = "Disables automatic content decompression")
-    private boolean contentCompressionDisabled;
+    protected boolean contentCompressionDisabled;
     @Metadata(label = "advanced", description = "Disables state (cookie) management")
-    private boolean cookieManagementDisabled;
+    protected boolean cookieManagementDisabled;
     @Metadata(label = "advanced", description = "Disables authentication scheme caching")
-    private boolean authCachingDisabled;
+    protected boolean authCachingDisabled;
     @Metadata(label = "advanced", description = "Disables connection state tracking")
-    private boolean connectionStateDisabled;
+    protected boolean connectionStateDisabled;
     @Metadata(label = "advanced",
               description = "Disables the default user agent set by this builder if none has been provided by the user")
-    private boolean defaultUserAgentDisabled;
+    protected boolean defaultUserAgentDisabled;
     @Metadata(label = "producer",
               defaultValue = "true",
               description = "If this option is true then IN exchange headers will be copied to OUT exchange headers according to copy strategy."
                             + " Setting this to false, allows to only include the headers from the HTTP response (not propagating IN headers).")
-    boolean copyHeaders = true;
+    protected boolean copyHeaders = true;
     @Metadata(label = "producer,advanced",
               description = "Whether to skip mapping all the Camel headers as HTTP request headers."
                             + " If there are no data from Camel headers needed to be included in the HTTP request then this can avoid"
                             + " parsing overhead with many object allocations for the JVM garbage collector.")
-    private boolean skipRequestHeaders;
+    protected boolean skipRequestHeaders;
     @Metadata(label = "producer,advanced",
               description = "Whether to skip mapping all the HTTP response headers to Camel headers."
                             + " If there are no data needed from HTTP headers then this can avoid parsing overhead"
                             + " with many object allocations for the JVM garbage collector.")
-    private boolean skipResponseHeaders;
+    protected boolean skipResponseHeaders;
 
     public HttpComponent() {
         this(HttpEndpoint.class);


[camel] 04/06: CAMEL-16264: camel-http - Add option to ignore request headers

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 d988d4790b834d0f5328954468b946c344563ddd
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Feb 26 07:35:40 2021 +0100

    CAMEL-16264: camel-http - Add option to ignore request headers
---
 .../apache/camel/catalog/docs/http-component.adoc  |   3 +-
 .../component/http/HttpEndpointConfigurer.java     |   6 ++
 .../component/http/HttpEndpointUriFactory.java     |   3 +-
 .../org/apache/camel/component/http/http.json      |   1 +
 .../org/apache/camel/component/http/https.json     |   1 +
 .../camel-http/src/main/docs/http-component.adoc   |   3 +-
 .../apache/camel/component/http/HttpEndpoint.java  |  21 +++-
 .../apache/camel/component/http/HttpProducer.java  | 119 +++++++++++----------
 .../endpoint/dsl/HttpEndpointBuilderFactory.java   |  39 +++++++
 .../modules/ROOT/pages/http-component.adoc         |   3 +-
 10 files changed, 139 insertions(+), 60 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/http-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/http-component.adoc
index 61d5f5f..9171e16 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/http-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/http-component.adoc
@@ -126,7 +126,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (49 parameters):
+=== Query Parameters (50 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -161,6 +161,7 @@ with the following path and query parameters:
 | *httpContext* (advanced) | To use a custom HttpContext instance |  | HttpContext
 | *maxTotalConnections* (advanced) | The maximum number of connections. | 200 | int
 | *useSystemProperties* (advanced) | To use System Properties as fallback for configuration | false | boolean
+| *skipRequestHeaders* (producer.advanced) | Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *skipResponseHeaders* (producer.advanced) | Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *proxyAuthDomain* (proxy) | Proxy authentication domain to use with NTML |  | String
 | *proxyAuthHost* (proxy) | Proxy authentication host |  | String
diff --git a/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointConfigurer.java b/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointConfigurer.java
index 237aa97..ba95b5c 100644
--- a/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointConfigurer.java
+++ b/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointConfigurer.java
@@ -106,6 +106,8 @@ public class HttpEndpointConfigurer extends PropertyConfigurerSupport implements
         case "proxyHost": target.setProxyHost(property(camelContext, java.lang.String.class, value)); return true;
         case "proxyport":
         case "proxyPort": target.setProxyPort(property(camelContext, int.class, value)); return true;
+        case "skiprequestheaders":
+        case "skipRequestHeaders": target.setSkipRequestHeaders(property(camelContext, boolean.class, value)); return true;
         case "skipresponseheaders":
         case "skipResponseHeaders": target.setSkipResponseHeaders(property(camelContext, boolean.class, value)); return true;
         case "sslcontextparameters":
@@ -210,6 +212,8 @@ public class HttpEndpointConfigurer extends PropertyConfigurerSupport implements
         case "proxyHost": return java.lang.String.class;
         case "proxyport":
         case "proxyPort": return int.class;
+        case "skiprequestheaders":
+        case "skipRequestHeaders": return boolean.class;
         case "skipresponseheaders":
         case "skipResponseHeaders": return boolean.class;
         case "sslcontextparameters":
@@ -315,6 +319,8 @@ public class HttpEndpointConfigurer extends PropertyConfigurerSupport implements
         case "proxyHost": return target.getProxyHost();
         case "proxyport":
         case "proxyPort": return target.getProxyPort();
+        case "skiprequestheaders":
+        case "skipRequestHeaders": return target.isSkipRequestHeaders();
         case "skipresponseheaders":
         case "skipResponseHeaders": return target.isSkipResponseHeaders();
         case "sslcontextparameters":
diff --git a/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointUriFactory.java b/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointUriFactory.java
index 9b247bd..4e4a6d3 100644
--- a/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointUriFactory.java
+++ b/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointUriFactory.java
@@ -21,7 +21,7 @@ public class HttpEndpointUriFactory extends org.apache.camel.support.component.E
     private static final Set<String> PROPERTY_NAMES;
     private static final Set<String> SECRET_PROPERTY_NAMES;
     static {
-        Set<String> props = new HashSet<>(50);
+        Set<String> props = new HashSet<>(51);
         props.add("clientBuilder");
         props.add("authMethodPriority");
         props.add("ignoreResponseBody");
@@ -42,6 +42,7 @@ public class HttpEndpointUriFactory extends org.apache.camel.support.component.E
         props.add("connectionClose");
         props.add("proxyHost");
         props.add("authPassword");
+        props.add("skipRequestHeaders");
         props.add("lazyStartProducer");
         props.add("preserveHostHeader");
         props.add("httpClientConfigurer");
diff --git a/components/camel-http/src/generated/resources/org/apache/camel/component/http/http.json b/components/camel-http/src/generated/resources/org/apache/camel/component/http/http.json
index fc55d55..3329ee8 100644
--- a/components/camel-http/src/generated/resources/org/apache/camel/component/http/http.json
+++ b/components/camel-http/src/generated/resources/org/apache/camel/component/http/http.json
@@ -90,6 +90,7 @@
     "httpContext": { "kind": "parameter", "displayName": "Http Context", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.protocol.HttpContext", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom HttpContext instance" },
     "maxTotalConnections": { "kind": "parameter", "displayName": "Max Total Connections", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 200, "description": "The maximum number of connections." },
     "useSystemProperties": { "kind": "parameter", "displayName": "Use System Properties", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To use System Properties as fallback for configuration" },
+    "skipRequestHeaders": { "kind": "parameter", "displayName": "Skip Request Headers", "group": "producer.advanced", "label": "producer.advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overh [...]
     "skipResponseHeaders": { "kind": "parameter", "displayName": "Skip Response Headers", "group": "producer.advanced", "label": "producer.advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations  [...]
     "proxyAuthDomain": { "kind": "parameter", "displayName": "Proxy Auth Domain", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication domain to use with NTML" },
     "proxyAuthHost": { "kind": "parameter", "displayName": "Proxy Auth Host", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication host" },
diff --git a/components/camel-http/src/generated/resources/org/apache/camel/component/http/https.json b/components/camel-http/src/generated/resources/org/apache/camel/component/http/https.json
index b2e1527..209faf2 100644
--- a/components/camel-http/src/generated/resources/org/apache/camel/component/http/https.json
+++ b/components/camel-http/src/generated/resources/org/apache/camel/component/http/https.json
@@ -90,6 +90,7 @@
     "httpContext": { "kind": "parameter", "displayName": "Http Context", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.http.protocol.HttpContext", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom HttpContext instance" },
     "maxTotalConnections": { "kind": "parameter", "displayName": "Max Total Connections", "group": "advanced", "label": "advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 200, "description": "The maximum number of connections." },
     "useSystemProperties": { "kind": "parameter", "displayName": "Use System Properties", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To use System Properties as fallback for configuration" },
+    "skipRequestHeaders": { "kind": "parameter", "displayName": "Skip Request Headers", "group": "producer.advanced", "label": "producer.advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overh [...]
     "skipResponseHeaders": { "kind": "parameter", "displayName": "Skip Response Headers", "group": "producer.advanced", "label": "producer.advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations  [...]
     "proxyAuthDomain": { "kind": "parameter", "displayName": "Proxy Auth Domain", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication domain to use with NTML" },
     "proxyAuthHost": { "kind": "parameter", "displayName": "Proxy Auth Host", "group": "proxy", "label": "producer,proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Proxy authentication host" },
diff --git a/components/camel-http/src/main/docs/http-component.adoc b/components/camel-http/src/main/docs/http-component.adoc
index 61d5f5f..9171e16 100644
--- a/components/camel-http/src/main/docs/http-component.adoc
+++ b/components/camel-http/src/main/docs/http-component.adoc
@@ -126,7 +126,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (49 parameters):
+=== Query Parameters (50 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -161,6 +161,7 @@ with the following path and query parameters:
 | *httpContext* (advanced) | To use a custom HttpContext instance |  | HttpContext
 | *maxTotalConnections* (advanced) | The maximum number of connections. | 200 | int
 | *useSystemProperties* (advanced) | To use System Properties as fallback for configuration | false | boolean
+| *skipRequestHeaders* (producer.advanced) | Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *skipResponseHeaders* (producer.advanced) | Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *proxyAuthDomain* (proxy) | Proxy authentication domain to use with NTML |  | String
 | *proxyAuthHost* (proxy) | Proxy authentication host |  | String
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
index 52e6c42..2ddb4c6 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
@@ -138,8 +138,14 @@ public class HttpEndpoint extends HttpCommonEndpoint {
                                                 + "be ignored. When set will override host header derived from url.")
     private String customHostHeader;
     @UriParam(label = "producer.advanced",
+              description = "Whether to skip mapping all the Camel headers as HTTP request headers."
+                            + " If there are no data from Camel headers needed to be included in the HTTP request then this can avoid"
+                            + " parsing overhead with many object allocations for the JVM garbage collector.")
+    private boolean skipRequestHeaders;
+    @UriParam(label = "producer.advanced",
               description = "Whether to skip mapping all the HTTP response headers to Camel headers."
-                            + " If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector.")
+                            + " If there are no data needed from HTTP headers then this can avoid parsing overhead"
+                            + " with many object allocations for the JVM garbage collector.")
     private boolean skipResponseHeaders;
 
     public HttpEndpoint() {
@@ -537,6 +543,19 @@ public class HttpEndpoint extends HttpCommonEndpoint {
         return customHostHeader;
     }
 
+    public boolean isSkipRequestHeaders() {
+        return skipRequestHeaders;
+    }
+
+    /**
+     * Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers
+     * needed to be included in the HTTP request then this can avoid parsing overhead with many object allocations for
+     * the JVM garbage collector.
+     */
+    public void setSkipRequestHeaders(boolean skipRequestHeaders) {
+        this.skipRequestHeaders = skipRequestHeaders;
+    }
+
     public boolean isSkipResponseHeaders() {
         return skipResponseHeaders;
     }
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
index e1869eb..7e53412 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
@@ -84,6 +84,8 @@ public class HttpProducer extends DefaultProducer {
 
     private static final Logger LOG = LoggerFactory.getLogger(HttpProducer.class);
 
+    private static final Integer OK_RESPONSE_CODE = 200;
+
     private HttpClient httpClient;
     private final HttpContext httpContext;
     private final boolean throwException;
@@ -156,68 +158,67 @@ public class HttpProducer extends DefaultProducer {
             int[] version = HttpHelper.parserHttpVersion(httpProtocolVersion);
             httpRequest.setProtocolVersion(new HttpVersion(version[0], version[1]));
         }
-        HeaderFilterStrategy strategy = getEndpoint().getHeaderFilterStrategy();
 
-        if (getEndpoint().getCustomHostHeader() != null) {
-            httpRequest.setHeader(HOST, getEndpoint().getCustomHostHeader());
-        }
+        HeaderFilterStrategy strategy = getEndpoint().getHeaderFilterStrategy();
 
-        // propagate headers as HTTP headers
-        if (strategy != null) {
-            final TypeConverter tc = exchange.getContext().getTypeConverter();
-            for (Map.Entry<String, Object> entry : in.getHeaders().entrySet()) {
-                String key = entry.getKey();
-                // we should not add headers for the parameters in the uri if we bridge the endpoint
-                // as then we would duplicate headers on both the endpoint uri, and in HTTP headers as well
-                if (skipRequestHeaders != null && skipRequestHeaders.containsKey(key)) {
-                    continue;
-                }
-                Object headerValue = entry.getValue();
-
-                if (headerValue != null) {
-                    if (headerValue instanceof String || headerValue instanceof Integer || headerValue instanceof Long
-                            || headerValue instanceof Boolean || headerValue instanceof Date) {
-                        // optimise for common types
-                        String value = headerValue.toString();
-                        if (!strategy.applyFilterToCamelHeaders(key, value, exchange)) {
-                            httpRequest.addHeader(key, value);
-                        }
+        if (!getEndpoint().isSkipRequestHeaders()) {
+            // propagate headers as HTTP headers
+            if (strategy != null) {
+                final TypeConverter tc = exchange.getContext().getTypeConverter();
+                for (Map.Entry<String, Object> entry : in.getHeaders().entrySet()) {
+                    String key = entry.getKey();
+                    // we should not add headers for the parameters in the uri if we bridge the endpoint
+                    // as then we would duplicate headers on both the endpoint uri, and in HTTP headers as well
+                    if (skipRequestHeaders != null && skipRequestHeaders.containsKey(key)) {
                         continue;
                     }
+                    Object headerValue = entry.getValue();
+
+                    if (headerValue != null) {
+                        if (headerValue instanceof String || headerValue instanceof Integer || headerValue instanceof Long
+                                || headerValue instanceof Boolean || headerValue instanceof Date) {
+                            // optimise for common types
+                            String value = headerValue.toString();
+                            if (!strategy.applyFilterToCamelHeaders(key, value, exchange)) {
+                                httpRequest.addHeader(key, value);
+                            }
+                            continue;
+                        }
 
-                    // use an iterator as there can be multiple values. (must not use a delimiter, and allow empty values)
-                    final Iterator<?> it = ObjectHelper.createIterator(headerValue, null, true);
-
-                    // the value to add as request header
-                    List<String> multiValues = null;
-                    String prev = null;
-
-                    // if its a multi value then check each value if we can add it and for multi values they
-                    // should be combined into a single value
-                    while (it.hasNext()) {
-                        String value = tc.convertTo(String.class, it.next());
-                        if (value != null && !strategy.applyFilterToCamelHeaders(key, value, exchange)) {
-                            if (prev == null) {
-                                prev = value;
-                            } else {
-                                // only create array for multi values when really needed
-                                if (multiValues == null) {
-                                    multiValues = new ArrayList<>();
-                                    multiValues.add(prev);
+                        // use an iterator as there can be multiple values. (must not use a delimiter, and allow empty values)
+                        final Iterator<?> it = ObjectHelper.createIterator(headerValue, null, true);
+
+                        // the value to add as request header
+                        List<String> multiValues = null;
+                        String prev = null;
+
+                        // if its a multi value then check each value if we can add it and for multi values they
+                        // should be combined into a single value
+                        while (it.hasNext()) {
+                            String value = tc.convertTo(String.class, it.next());
+                            if (value != null && !strategy.applyFilterToCamelHeaders(key, value, exchange)) {
+                                if (prev == null) {
+                                    prev = value;
+                                } else {
+                                    // only create array for multi values when really needed
+                                    if (multiValues == null) {
+                                        multiValues = new ArrayList<>();
+                                        multiValues.add(prev);
+                                    }
+                                    multiValues.add(value);
                                 }
-                                multiValues.add(value);
                             }
                         }
-                    }
 
-                    // add the value(s) as a http request header
-                    if (multiValues != null) {
-                        // use the default toString of a ArrayList to create in the form [xxx, yyy]
-                        // if multi valued, for a single value, then just output the value as is
-                        String s = multiValues.size() > 1 ? multiValues.toString() : multiValues.get(0);
-                        httpRequest.addHeader(key, s);
-                    } else if (prev != null) {
-                        httpRequest.addHeader(key, prev);
+                        // add the value(s) as a http request header
+                        if (multiValues != null) {
+                            // use the default toString of a ArrayList to create in the form [xxx, yyy]
+                            // if multi valued, for a single value, then just output the value as is
+                            String s = multiValues.size() > 1 ? multiValues.toString() : multiValues.get(0);
+                            httpRequest.addHeader(key, s);
+                        } else if (prev != null) {
+                            httpRequest.addHeader(key, prev);
+                        }
                     }
                 }
             }
@@ -235,13 +236,16 @@ public class HttpProducer extends DefaultProducer {
             }
         }
 
+        if (getEndpoint().getCustomHostHeader() != null) {
+            httpRequest.setHeader(HOST, getEndpoint().getCustomHostHeader());
+        }
         //In reverse proxy applications it can be desirable for the downstream service to see the original Host header
         //if this option is set, and the exchange Host header is not null, we will set it's current value on the httpRequest
         if (getEndpoint().isPreserveHostHeader()) {
             String hostHeader = exchange.getIn().getHeader("Host", String.class);
             if (hostHeader != null) {
                 //HttpClient 4 will check to see if the Host header is present, and use it if it is, see org.apache.http.protocol.RequestTargetHost in httpcore
-                httpRequest.setHeader("Host", hostHeader);
+                httpRequest.setHeader(HOST, hostHeader);
             }
         }
 
@@ -317,7 +321,12 @@ public class HttpProducer extends DefaultProducer {
         Object response = extractResponseBody(httpRequest, httpResponse, exchange, getEndpoint().isIgnoreResponseBody());
         Message answer = exchange.getOut();
 
-        answer.setHeader(Exchange.HTTP_RESPONSE_CODE, responseCode);
+        // optimize for 200 response code as the boxing is outside the cached integers
+        if (responseCode == 200) {
+            answer.setHeader(Exchange.HTTP_RESPONSE_CODE, OK_RESPONSE_CODE);
+        } else {
+            answer.setHeader(Exchange.HTTP_RESPONSE_CODE, responseCode);
+        }
         if (httpResponse.getStatusLine() != null) {
             answer.setHeader(Exchange.HTTP_RESPONSE_TEXT, httpResponse.getStatusLine().getReasonPhrase());
         }
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java
index 2561783..d3e0b1e 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java
@@ -1440,6 +1440,45 @@ public interface HttpEndpointBuilderFactory {
             return this;
         }
         /**
+         * Whether to skip mapping all the Camel headers as HTTP request
+         * headers. If there are no data from Camel headers needed to be
+         * included in the HTTP request then this can avoid parsing overhead
+         * with many object allocations for the JVM garbage collector.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: producer.advanced
+         * 
+         * @param skipRequestHeaders the value to set
+         * @return the dsl builder
+         */
+        default AdvancedHttpEndpointBuilder skipRequestHeaders(
+                boolean skipRequestHeaders) {
+            doSetProperty("skipRequestHeaders", skipRequestHeaders);
+            return this;
+        }
+        /**
+         * Whether to skip mapping all the Camel headers as HTTP request
+         * headers. If there are no data from Camel headers needed to be
+         * included in the HTTP request then this can avoid parsing overhead
+         * with many object allocations for the JVM garbage collector.
+         * 
+         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
+         * type.
+         * 
+         * Default: false
+         * Group: producer.advanced
+         * 
+         * @param skipRequestHeaders the value to set
+         * @return the dsl builder
+         */
+        default AdvancedHttpEndpointBuilder skipRequestHeaders(
+                String skipRequestHeaders) {
+            doSetProperty("skipRequestHeaders", skipRequestHeaders);
+            return this;
+        }
+        /**
          * Whether to skip mapping all the HTTP response headers to Camel
          * headers. If there are no data needed from HTTP headers then this can
          * avoid parsing overhead with many object allocations for the JVM
diff --git a/docs/components/modules/ROOT/pages/http-component.adoc b/docs/components/modules/ROOT/pages/http-component.adoc
index 3d3f2a6..e9e0a90 100644
--- a/docs/components/modules/ROOT/pages/http-component.adoc
+++ b/docs/components/modules/ROOT/pages/http-component.adoc
@@ -128,7 +128,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (49 parameters):
+=== Query Parameters (50 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -163,6 +163,7 @@ with the following path and query parameters:
 | *httpContext* (advanced) | To use a custom HttpContext instance |  | HttpContext
 | *maxTotalConnections* (advanced) | The maximum number of connections. | 200 | int
 | *useSystemProperties* (advanced) | To use System Properties as fallback for configuration | false | boolean
+| *skipRequestHeaders* (producer.advanced) | Whether to skip mapping all the Camel headers as HTTP request headers. If there are no data from Camel headers needed to be included in the HTTP request then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *skipResponseHeaders* (producer.advanced) | Whether to skip mapping all the HTTP response headers to Camel headers. If there are no data needed from HTTP headers then this can avoid parsing overhead with many object allocations for the JVM garbage collector. | false | boolean
 | *proxyAuthDomain* (proxy) | Proxy authentication domain to use with NTML |  | String
 | *proxyAuthHost* (proxy) | Proxy authentication host |  | String


[camel] 01/06: camel-http - polished

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 b7c718a0306bd3bfae4a2e9b6b21dd99db1144ea
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Feb 26 06:53:12 2021 +0100

    camel-http - polished
---
 .../camel/component/http/HttpEntityConverter.java      | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEntityConverter.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEntityConverter.java
index 7ed5dd2..8302d0d 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEntityConverter.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEntityConverter.java
@@ -61,7 +61,7 @@ public final class HttpEntityConverter {
 
     private static HttpEntity asHttpEntity(InputStream in, Exchange exchange) throws IOException {
         InputStreamEntity entity;
-        if (!exchange.getProperty(Exchange.SKIP_GZIP_ENCODING, Boolean.FALSE, Boolean.class)) {
+        if (exchange != null && !exchange.getProperty(Exchange.SKIP_GZIP_ENCODING, Boolean.FALSE, Boolean.class)) {
             String contentEncoding = exchange.getIn().getHeader(Exchange.CONTENT_ENCODING, String.class);
             InputStream stream = GZIPHelper.compressGzip(contentEncoding, in);
             entity = new InputStreamEntity(
@@ -72,9 +72,13 @@ public final class HttpEntityConverter {
         }
         if (exchange != null) {
             String contentEncoding = exchange.getIn().getHeader(Exchange.CONTENT_ENCODING, String.class);
+            if (contentEncoding != null) {
+                entity.setContentEncoding(contentEncoding);
+            }
             String contentType = ExchangeHelper.getContentType(exchange);
-            entity.setContentEncoding(contentEncoding);
-            entity.setContentType(contentType);
+            if (contentType != null) {
+                entity.setContentType(contentType);
+            }
         }
         return entity;
     }
@@ -93,9 +97,13 @@ public final class HttpEntityConverter {
         }
         if (exchange != null) {
             String contentEncoding = exchange.getIn().getHeader(Exchange.CONTENT_ENCODING, String.class);
+            if (contentEncoding != null) {
+                entity.setContentEncoding(contentEncoding);
+            }
             String contentType = ExchangeHelper.getContentType(exchange);
-            entity.setContentEncoding(contentEncoding);
-            entity.setContentType(contentType);
+            if (contentType != null) {
+                entity.setContentType(contentType);
+            }
         }
         return entity;
     }