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 <claus.ib...@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: <code>boolean</code> 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: <code>boolean</code> 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: <code>boolean</code> 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: <code>boolean</code> 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: <code>boolean</code> 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: <code>boolean</code> 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: <code>boolean</code> 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 <code>boolean</code> + * 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: <code>boolean</code> 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 <code>boolean</code> + * 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: <code>boolean</code> 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 <code>boolean</code> - * 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: <code>boolean</code> 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 <code>boolean</code> - * 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