This is an automated email from the ASF dual-hosted git repository. zregvart 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 4eb0a75 CAMEL-12267: Make CometD transport properties c... 4eb0a75 is described below commit 4eb0a758bf6d7f84cdb144fb4e7b26d8336c2268 Author: BEAUME <sebastien.bea...@capgemini.com> AuthorDate: Wed Feb 14 16:52:51 2018 +0100 CAMEL-12267: Make CometD transport properties c... ...onfigurable --- .../src/main/docs/salesforce-component.adoc | 5 +++-- .../camel/component/salesforce/SalesforceComponent.java | 13 +++++++++++++ .../salesforce/internal/streaming/SubscriptionHelper.java | 5 ++++- .../springboot/SalesforceComponentConfiguration.java | 15 +++++++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-) 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 5b1360d..fdbdc86 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 @@ -550,7 +550,7 @@ This Maven plugin generates DTOs for the Camel // component options: START -The Salesforce component supports 28 options which are listed below. +The Salesforce component supports 29 options which are listed below. @@ -570,6 +570,7 @@ The Salesforce component supports 28 options which are listed below. | *lazyLogin* (security) | If set to true prevents the component from authenticating to Salesforce with the start of the component. You would generaly set this to the (default) false and authenticate early and be immediately aware of any authentication issues. | false | boolean | *config* (common) | Global endpoint configuration - use to set values that are common to all endpoints | | SalesforceEndpoint Config | *httpClientProperties* (common) | 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. | | Map +| *longPollingTransport Properties* (common) | Used to set any properties that can be configured on the LongPollingTransport used by the BayeuxClient (CometD) used by the streaming api | | Map | *sslContextParameters* (security) | SSL parameters to use see SSLContextParameters class for all available options. | | SSLContextParameters | *useGlobalSslContext Parameters* (security) | Enable usage of global SSL context parameters | false | boolean | *httpProxyHost* (proxy) | Hostname of the HTTP proxy server to use. | | String @@ -689,4 +690,4 @@ DateTime, and picklist fields are mapped to generated Java Enumerations. * Configuring Camel * Component * Endpoint -* Getting Started \ No newline at end of file +* Getting Started 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 5b3dd9c..bcd91e5 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 @@ -151,6 +151,11 @@ public class SalesforceComponent extends DefaultComponent implements VerifiableC label = "common,advanced") private Map<String, Object> httpClientProperties; + @Metadata(description = "Used to set any properties that can be configured on the LongPollingTransport used by the" + + " BayeuxClient (CometD) used by the streaming api", + label = "common,advanced") + private Map<String, Object> longPollingTransportProperties; + @Metadata(description = "SSL parameters to use, see SSLContextParameters class for all available options.", label = "common,security") private SSLContextParameters sslContextParameters; @@ -502,6 +507,14 @@ public class SalesforceComponent extends DefaultComponent implements VerifiableC this.httpClientProperties = httpClientProperties; } + public Map<String, Object> getLongPollingTransportProperties() { + return longPollingTransportProperties; + } + + public void setLongPollingTransportProperties(Map<String, Object> longPollingTransportProperties) { + this.longPollingTransportProperties = longPollingTransportProperties; + } + public SSLContextParameters getSslContextParameters() { return sslContextParameters; } diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java index 85d5f71..a23a22e 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java @@ -333,8 +333,11 @@ public class SubscriptionHelper extends ServiceSupport { // use default Jetty client from SalesforceComponent, its shared by all consumers final SalesforceHttpClient httpClient = component.getConfig().getHttpClient(); - Map<String, Object> options = new HashMap<String, Object>(); + Map<String, Object> options = new HashMap<>(); options.put(ClientTransport.MAX_NETWORK_DELAY_OPTION, httpClient.getTimeout()); + if(component.getLongPollingTransportProperties() != null){ + options = component.getLongPollingTransportProperties(); + } final SalesforceSession session = component.getSession(); // check login access token diff --git a/platforms/spring-boot/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java index 094dbfa..7c98c3e 100644 --- a/platforms/spring-boot/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java @@ -134,6 +134,12 @@ public class SalesforceComponentConfiguration */ private Map<String, Object> httpClientProperties; /** + * Used to set any properties that can be configured on the + * LongPollingTransport used by the BayeuxClient (CometD) used by the + * streaming api + */ + private Map<String, Object> longPollingTransportProperties; + /** * SSL parameters to use see SSLContextParameters class for all available * options. */ @@ -310,6 +316,15 @@ public class SalesforceComponentConfiguration this.httpClientProperties = httpClientProperties; } + public Map<String, Object> getLongPollingTransportProperties() { + return longPollingTransportProperties; + } + + public void setLongPollingTransportProperties( + Map<String, Object> longPollingTransportProperties) { + this.longPollingTransportProperties = longPollingTransportProperties; + } + public SSLContextParameters getSslContextParameters() { return sslContextParameters; } -- To stop receiving notification emails like this one, please contact zregv...@apache.org.