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


The following commit(s) were added to refs/heads/master by this push:
     new 9433dde  CAMEL-15863: camel-salesforce: HttpRequestBufferSize (#4666)
9433dde is described below

commit 9433ddec5cc49a891b9fd753a222c0006b49b557
Author: Jeremy Ross <jer...@jeremyross.org>
AuthorDate: Tue Nov 24 08:09:50 2020 -0600

    CAMEL-15863: camel-salesforce: HttpRequestBufferSize (#4666)
    
    Added as an option, defaulted to 8192.
---
 .../camel/catalog/docs/salesforce-component.adoc   |  3 ++-
 .../salesforce/SalesforceComponentConfigurer.java  |  6 ++++++
 .../camel/component/salesforce/salesforce.json     |  1 +
 .../src/main/docs/salesforce-component.adoc        |  3 ++-
 .../component/salesforce/SalesforceComponent.java  | 25 ++++++++++++++++++++--
 .../dsl/SalesforceComponentBuilderFactory.java     | 15 +++++++++++++
 .../modules/ROOT/pages/salesforce-component.adoc   |  3 ++-
 7 files changed, 51 insertions(+), 5 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/salesforce-component.adoc
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/salesforce-component.adoc
index 2ba9414..d230d0b 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/salesforce-component.adoc
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/salesforce-component.adoc
@@ -656,7 +656,7 @@ for details on how to generate the DTO.
 
 
 // component options: START
-The Salesforce component supports 72 options, which are listed below.
+The Salesforce component supports 73 options, which are listed below.
 
 
 
@@ -676,6 +676,7 @@ The Salesforce component supports 72 options, which are 
listed below.
 | *httpClientConnectionTimeout* (common) | Connection timeout used by the 
HttpClient when connecting to the Salesforce server. | 60000 | long
 | *httpClientIdleTimeout* (common) | Timeout used by the HttpClient when 
waiting for response from the Salesforce server. | 10000 | long
 | *httpMaxContentLength* (common) | Max content length of an HTTP response. |  
| Integer
+| *httpRequestBufferSize* (common) | HTTP request buffer size. May need to be 
increased for large SOQL queries. | 8192 | Integer
 | *includeDetails* (common) | Include details in Salesforce1 Analytics report, 
defaults to false. |  | Boolean
 | *initialReplayIdMap* (common) | Replay IDs to start from per channel name. | 
 | Map
 | *instanceId* (common) | Salesforce1 Analytics report execution instance ID | 
 | String
diff --git 
a/components/camel-salesforce/camel-salesforce-component/src/generated/java/org/apache/camel/component/salesforce/SalesforceComponentConfigurer.java
 
b/components/camel-salesforce/camel-salesforce-component/src/generated/java/org/apache/camel/component/salesforce/SalesforceComponentConfigurer.java
index ef77553..c912d1d 100644
--- 
a/components/camel-salesforce/camel-salesforce-component/src/generated/java/org/apache/camel/component/salesforce/SalesforceComponentConfigurer.java
+++ 
b/components/camel-salesforce/camel-salesforce-component/src/generated/java/org/apache/camel/component/salesforce/SalesforceComponentConfigurer.java
@@ -88,6 +88,8 @@ public class SalesforceComponentConfigurer extends 
PropertyConfigurerSupport imp
         case "httpProxyUseDigestAuth": 
target.setHttpProxyUseDigestAuth(property(camelContext, boolean.class, value)); 
return true;
         case "httpproxyusername":
         case "httpProxyUsername": 
target.setHttpProxyUsername(property(camelContext, java.lang.String.class, 
value)); return true;
+        case "httprequestbuffersize":
+        case "httpRequestBufferSize": 
target.setHttpRequestBufferSize(property(camelContext, java.lang.Integer.class, 
value)); return true;
         case "includedetails":
         case "includeDetails": 
getOrCreateConfig(target).setIncludeDetails(property(camelContext, 
java.lang.Boolean.class, value)); return true;
         case "initialreplayidmap":
@@ -233,6 +235,8 @@ public class SalesforceComponentConfigurer extends 
PropertyConfigurerSupport imp
         case "httpProxyUseDigestAuth": return boolean.class;
         case "httpproxyusername":
         case "httpProxyUsername": return java.lang.String.class;
+        case "httprequestbuffersize":
+        case "httpRequestBufferSize": return java.lang.Integer.class;
         case "includedetails":
         case "includeDetails": return java.lang.Boolean.class;
         case "initialreplayidmap":
@@ -379,6 +383,8 @@ public class SalesforceComponentConfigurer extends 
PropertyConfigurerSupport imp
         case "httpProxyUseDigestAuth": return 
target.isHttpProxyUseDigestAuth();
         case "httpproxyusername":
         case "httpProxyUsername": return target.getHttpProxyUsername();
+        case "httprequestbuffersize":
+        case "httpRequestBufferSize": return target.getHttpRequestBufferSize();
         case "includedetails":
         case "includeDetails": return 
getOrCreateConfig(target).getIncludeDetails();
         case "initialreplayidmap":
diff --git 
a/components/camel-salesforce/camel-salesforce-component/src/generated/resources/org/apache/camel/component/salesforce/salesforce.json
 
b/components/camel-salesforce/camel-salesforce-component/src/generated/resources/org/apache/camel/component/salesforce/salesforce.json
index 6af27b1..a9e7ddd 100644
--- 
a/components/camel-salesforce/camel-salesforce-component/src/generated/resources/org/apache/camel/component/salesforce/salesforce.json
+++ 
b/components/camel-salesforce/camel-salesforce-component/src/generated/resources/org/apache/camel/component/salesforce/salesforce.json
@@ -36,6 +36,7 @@
     "httpClientConnectionTimeout": { "kind": "property", "displayName": "Http 
Client Connection Timeout", "group": "common", "label": "common", "required": 
false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": 
false, "secret": false, "defaultValue": 60000, "description": "Connection 
timeout used by the HttpClient when connecting to the Salesforce server." },
     "httpClientIdleTimeout": { "kind": "property", "displayName": "Http Client 
Idle Timeout", "group": "common", "label": "common", "required": false, "type": 
"integer", "javaType": "long", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": 10000, "description": "Timeout used by the 
HttpClient when waiting for response from the Salesforce server." },
     "httpMaxContentLength": { "kind": "property", "displayName": "Http Max 
Content Length", "group": "common", "label": "common", "required": false, 
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "description": "Max content length of an 
HTTP response." },
+    "httpRequestBufferSize": { "kind": "property", "displayName": "Http 
Request Buffer Size", "group": "common", "label": "common", "required": false, 
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": "8192", "description": 
"HTTP request buffer size. May need to be increased for large SOQL queries." },
     "includeDetails": { "kind": "property", "displayName": "Include Details", 
"group": "common", "label": "", "required": false, "type": "boolean", 
"javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.salesforce.SalesforceEndpointConfig", 
"configurationField": "config", "description": "Include details in Salesforce1 
Analytics report, defaults to false." },
     "initialReplayIdMap": { "kind": "property", "displayName": "Initial Replay 
Id Map", "group": "common", "label": "", "required": false, "type": "object", 
"javaType": "java.util.Map<java.lang.String, java.lang.Long>", "deprecated": 
false, "autowired": false, "secret": false, "configurationClass": 
"org.apache.camel.component.salesforce.SalesforceEndpointConfig", 
"configurationField": "config", "description": "Replay IDs to start from per 
channel name." },
     "instanceId": { "kind": "property", "displayName": "Instance Id", "group": 
"common", "label": "", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"configurationClass": 
"org.apache.camel.component.salesforce.SalesforceEndpointConfig", 
"configurationField": "config", "description": "Salesforce1 Analytics report 
execution instance ID" },
diff --git 
a/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc
 
b/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc
index 2ba9414..d230d0b 100644
--- 
a/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc
+++ 
b/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc
@@ -656,7 +656,7 @@ for details on how to generate the DTO.
 
 
 // component options: START
-The Salesforce component supports 72 options, which are listed below.
+The Salesforce component supports 73 options, which are listed below.
 
 
 
@@ -676,6 +676,7 @@ The Salesforce component supports 72 options, which are 
listed below.
 | *httpClientConnectionTimeout* (common) | Connection timeout used by the 
HttpClient when connecting to the Salesforce server. | 60000 | long
 | *httpClientIdleTimeout* (common) | Timeout used by the HttpClient when 
waiting for response from the Salesforce server. | 10000 | long
 | *httpMaxContentLength* (common) | Max content length of an HTTP response. |  
| Integer
+| *httpRequestBufferSize* (common) | HTTP request buffer size. May need to be 
increased for large SOQL queries. | 8192 | Integer
 | *includeDetails* (common) | Include details in Salesforce1 Analytics report, 
defaults to false. |  | Boolean
 | *initialReplayIdMap* (common) | Replay IDs to start from per channel name. | 
 | Map
 | *instanceId* (common) | Salesforce1 Analytics report execution instance ID | 
 | String
diff --git 
a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java
 
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java
index 4f5e04b..047b1fd 100644
--- 
a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java
+++ 
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java
@@ -82,9 +82,12 @@ public class SalesforceComponent extends DefaultComponent 
implements SSLContextP
     public static final String HTTP_CONNECTION_TIMEOUT = 
"httpConnectionTimeout";
     public static final String HTTP_IDLE_TIMEOUT = "httpIdleTimeout";
     public static final String HTTP_MAX_CONTENT_LENGTH = 
"httpMaxContentLength";
+    public static final String HTTP_REQUEST_BUFFER_SIZE = 
"httpRequestBufferSize";
 
     static final int CONNECTION_TIMEOUT = 60000;
     static final int IDLE_TIMEOUT = 10000;
+    static final int REQUEST_BUFFER_SIZE = 8192;
+
     static final Pattern SOBJECT_NAME_PATTERN = 
Pattern.compile("^.*[\\?&]sObjectName=([^&,]+).*$");
     static final String APEX_CALL_PREFIX = OperationName.APEX_CALL.value() + 
"/";
 
@@ -168,6 +171,11 @@ public class SalesforceComponent extends DefaultComponent 
implements SSLContextP
     @Metadata(description = "Max content length of an HTTP response.", label = 
"common")
     private Integer httpMaxContentLength;
 
+    @Metadata(description = "HTTP request buffer size. May need to be 
increased for large SOQL" +
+                            " queries.",
+              label = "common", defaultValue = "" + REQUEST_BUFFER_SIZE)
+    private Integer httpRequestBufferSize;
+
     @Metadata(description = "Used to set any properties that can be configured 
on the underlying HTTP client. Have a"
                             + " look at properties of SalesforceHttpClient and 
the Jetty HttpClient for all available options.",
               label = "common,advanced")
@@ -251,7 +259,6 @@ public class SalesforceComponent extends DefaultComponent 
implements SSLContextP
 
     public SalesforceComponent(CamelContext context) {
         super(context);
-
         registerExtension(SalesforceComponentVerifierExtension::new);
         registerExtension(SalesforceMetaDataExtension::new);
     }
@@ -605,6 +612,14 @@ public class SalesforceComponent extends DefaultComponent 
implements SSLContextP
         this.httpMaxContentLength = httpMaxContentLength;
     }
 
+    public Integer getHttpRequestBufferSize() {
+        return httpRequestBufferSize;
+    }
+
+    public void setHttpRequestBufferSize(Integer httpRequestBufferSize) {
+        this.httpRequestBufferSize = httpRequestBufferSize;
+    }
+
     public String getHttpProxyHost() {
         return httpProxyHost;
     }
@@ -797,6 +812,11 @@ public class SalesforceComponent extends DefaultComponent 
implements SSLContextP
         final Long httpIdleTimeout = typeConverter.convertTo(Long.class, 
httpClientProperties.get(HTTP_IDLE_TIMEOUT));
         final Integer maxContentLength
                 = typeConverter.convertTo(Integer.class, 
httpClientProperties.get(HTTP_MAX_CONTENT_LENGTH));
+        Integer requestBufferSize
+                = typeConverter.convertTo(Integer.class, 
httpClientProperties.get(HTTP_REQUEST_BUFFER_SIZE));
+        if (requestBufferSize == null) {
+            requestBufferSize = REQUEST_BUFFER_SIZE;
+        }
 
         final String httpProxyHost = typeConverter.convertTo(String.class, 
httpClientProperties.get(HTTP_PROXY_HOST));
         final Integer httpProxyPort = typeConverter.convertTo(Integer.class, 
httpClientProperties.get(HTTP_PROXY_PORT));
@@ -825,6 +845,7 @@ public class SalesforceComponent extends DefaultComponent 
implements SSLContextP
         if (maxContentLength != null) {
             httpClient.setMaxContentLength(maxContentLength);
         }
+        httpClient.setRequestBufferSize(requestBufferSize);
 
         // set HTTP proxy settings
         if (httpProxyHost != null && httpProxyPort != null) {
@@ -857,7 +878,6 @@ public class SalesforceComponent extends DefaultComponent 
implements SSLContextP
             }
             
httpClient.getAuthenticationStore().addAuthentication(authentication);
         }
-
         return httpClient;
     }
 
@@ -875,6 +895,7 @@ public class SalesforceComponent extends DefaultComponent 
implements SSLContextP
         putValueIfGivenTo(httpClientProperties, HTTP_PROXY_REALM, 
salesforce::getHttpProxyRealm);
         putValueIfGivenTo(httpClientProperties, HTTP_PROXY_AUTH_URI, 
salesforce::getHttpProxyAuthUri);
         putValueIfGivenTo(httpClientProperties, HTTP_MAX_CONTENT_LENGTH, 
salesforce::getHttpMaxContentLength);
+        putValueIfGivenTo(httpClientProperties, HTTP_REQUEST_BUFFER_SIZE, 
salesforce::getHttpRequestBufferSize);
 
         if (ObjectHelper.isNotEmpty(salesforce.getHttpProxyHost())) {
             // let's not put `false` values in client properties if no proxy is
diff --git 
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SalesforceComponentBuilderFactory.java
 
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SalesforceComponentBuilderFactory.java
index 8aa9f33..7b2d469 100644
--- 
a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SalesforceComponentBuilderFactory.java
+++ 
b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SalesforceComponentBuilderFactory.java
@@ -215,6 +215,20 @@ public interface SalesforceComponentBuilderFactory {
             return this;
         }
         /**
+         * HTTP request buffer size. May need to be increased for large SOQL
+         * queries.
+         * 
+         * The option is a: <code>java.lang.Integer</code> type.
+         * 
+         * Default: 8192
+         * Group: common
+         */
+        default SalesforceComponentBuilder httpRequestBufferSize(
+                java.lang.Integer httpRequestBufferSize) {
+            doSetProperty("httpRequestBufferSize", httpRequestBufferSize);
+            return this;
+        }
+        /**
          * Include details in Salesforce1 Analytics report, defaults to false.
          * 
          * The option is a: <code>java.lang.Boolean</code> type.
@@ -1047,6 +1061,7 @@ public interface SalesforceComponentBuilderFactory {
             case "httpClientConnectionTimeout": ((SalesforceComponent) 
component).setHttpClientConnectionTimeout((long) value); return true;
             case "httpClientIdleTimeout": ((SalesforceComponent) 
component).setHttpClientIdleTimeout((long) value); return true;
             case "httpMaxContentLength": ((SalesforceComponent) 
component).setHttpMaxContentLength((java.lang.Integer) value); return true;
+            case "httpRequestBufferSize": ((SalesforceComponent) 
component).setHttpRequestBufferSize((java.lang.Integer) value); return true;
             case "includeDetails": 
getOrCreateConfiguration((SalesforceComponent) 
component).setIncludeDetails((java.lang.Boolean) value); return true;
             case "initialReplayIdMap": 
getOrCreateConfiguration((SalesforceComponent) 
component).setInitialReplayIdMap((java.util.Map) value); return true;
             case "instanceId": getOrCreateConfiguration((SalesforceComponent) 
component).setInstanceId((java.lang.String) value); return true;
diff --git a/docs/components/modules/ROOT/pages/salesforce-component.adoc 
b/docs/components/modules/ROOT/pages/salesforce-component.adoc
index 1e57335..984fdb1 100644
--- a/docs/components/modules/ROOT/pages/salesforce-component.adoc
+++ b/docs/components/modules/ROOT/pages/salesforce-component.adoc
@@ -658,7 +658,7 @@ for details on how to generate the DTO.
 
 
 // component options: START
-The Salesforce component supports 72 options, which are listed below.
+The Salesforce component supports 73 options, which are listed below.
 
 
 
@@ -678,6 +678,7 @@ The Salesforce component supports 72 options, which are 
listed below.
 | *httpClientConnectionTimeout* (common) | Connection timeout used by the 
HttpClient when connecting to the Salesforce server. | 60000 | long
 | *httpClientIdleTimeout* (common) | Timeout used by the HttpClient when 
waiting for response from the Salesforce server. | 10000 | long
 | *httpMaxContentLength* (common) | Max content length of an HTTP response. |  
| Integer
+| *httpRequestBufferSize* (common) | HTTP request buffer size. May need to be 
increased for large SOQL queries. | 8192 | Integer
 | *includeDetails* (common) | Include details in Salesforce1 Analytics report, 
defaults to false. |  | Boolean
 | *initialReplayIdMap* (common) | Replay IDs to start from per channel name. | 
 | Map
 | *instanceId* (common) | Salesforce1 Analytics report execution instance ID | 
 | String

Reply via email to