You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2023/03/27 19:22:50 UTC

[camel] branch main created (now 706b3371047)

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

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


      at 706b3371047 Regen

This branch includes the following new commits:

     new c6809b23457 [CAMEL-19188] Make GraphQL component lenient (#9655)
     new 706b3371047 Regen

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[camel] 02/02: Regen

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

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

commit 706b337104729bd316b8b9344af1f54fa80c8dac
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Mar 27 21:08:59 2023 +0200

    Regen
---
 .../apache/camel/catalog/components/graphql.json   |   2 +-
 .../camel/catalog/components/salesforce.json       |  20 ++-
 .../dsl/SalesforceComponentBuilderFactory.java     | 102 +++++++++++++
 .../src/generated/resources/metadata.json          |   2 +-
 .../builder/endpoint/StaticEndpointBuilders.java   |   8 +-
 .../dsl/SalesforceEndpointBuilderFactory.java      | 159 ++++++++++++++++++++-
 6 files changed, 276 insertions(+), 17 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/graphql.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/graphql.json
index 5efbcb8c13d..55a2f26cbf0 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/graphql.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/graphql.json
@@ -19,7 +19,7 @@
     "api": false,
     "consumerOnly": false,
     "producerOnly": true,
-    "lenientProperties": false
+    "lenientProperties": true
   },
   "componentProperties": {
     "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 [...]
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/salesforce.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/salesforce.json
index 2a9bb649827..3f77024c43b 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/salesforce.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/salesforce.json
@@ -81,6 +81,10 @@
     "workerPoolMaxSize": { "kind": "property", "displayName": "Worker Pool Max Size", "group": "common (advanced)", "label": "common,advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 20, "description": "Maximum size of the thread pool used to handle HTTP responses." },
     "workerPoolSize": { "kind": "property", "displayName": "Worker Pool Size", "group": "common (advanced)", "label": "common,advanced", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 10, "description": "Size of the thread pool used to handle HTTP responses." },
     "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...]
+    "pubSubBatchSize": { "kind": "property", "displayName": "Pub Sub Batch Size", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 100, "configurationClass": "org.apache.camel.component.salesforce.SalesforceEndpointConfig", "configurationField": "config", "description": "Max number of events to receive in a batch from the Pub\/Sub API." },
+    "pubSubDeserializeType": { "kind": "property", "displayName": "Pub Sub Deserialize Type", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.salesforce.PubSubDeserializeType", "enum": [ "AVRO", "SPECIFIC_RECORD", "GENERIC_RECORD", "POJO", "JSON" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "AVRO", "configurationClass": "org.apache.camel.component.salesforce.SalesforceEndpointConfig", " [...]
+    "pubSubPojoClass": { "kind": "property", "displayName": "Pub Sub Pojo Class", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.salesforce.SalesforceEndpointConfig", "configurationField": "config", "description": "Fully qualified class name to deserialize Pub\/Sub API event to." },
+    "replayPreset": { "kind": "property", "displayName": "Replay Preset", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "com.salesforce.eventbus.protobuf.ReplayPreset", "enum": [ "LATEST", "EARLIEST", "CUSTOM" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "LATEST", "configurationClass": "org.apache.camel.component.salesforce.SalesforceEndpointConfig", "configurationField": "config", "description": "Replay preset  [...]
     "allOrNone": { "kind": "property", "displayName": "All Or None", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.salesforce.SalesforceEndpointConfig", "configurationField": "config", "description": "Composite API option to indicate to rollback all records if any are not successful." },
     "apexUrl": { "kind": "property", "displayName": "Apex Url", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.salesforce.SalesforceEndpointConfig", "configurationField": "config", "description": "APEX method URL" },
     "compositeMethod": { "kind": "property", "displayName": "Composite Method", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.salesforce.SalesforceEndpointConfig", "configurationField": "config", "description": "Composite (raw) method." },
@@ -111,13 +115,16 @@
     "loginConfig": { "kind": "property", "displayName": "Login Config", "group": "security", "label": "common,security", "required": false, "type": "object", "javaType": "org.apache.camel.component.salesforce.SalesforceLoginConfig", "deprecated": false, "autowired": false, "secret": false, "description": "All authentication configuration in one nested bean, all properties set there can be set directly on the component as well" },
     "loginUrl": { "kind": "property", "displayName": "Login Url", "group": "security", "label": "common,security", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "https:\/\/login.salesforce.com", "description": "URL of the Salesforce instance used for authentication, by default set to https:\/\/login.salesforce.com" },
     "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "Password used in OAuth flow to gain access to access token. It's easy to get started with password OAuth flow, but in general one should avoid it as it is deemed less secure than other flows. Make sure that you append security token to  [...]
+    "pubSubHost": { "kind": "property", "displayName": "Pub Sub Host", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "api.pubsub.salesforce.com", "description": "Pub\/Sub host" },
+    "pubSubPort": { "kind": "property", "displayName": "Pub Sub Port", "group": "security", "label": "common,security", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 7443, "description": "Pub\/Sub port" },
     "refreshToken": { "kind": "property", "displayName": "Refresh Token", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "Refresh token already obtained in the refresh token OAuth flow. One needs to setup a web application and configure a callback URL to receive the refresh token, or configure using the builtin callback at https:\/\/login.salesfor [...]
     "sslContextParameters": { "kind": "property", "displayName": "Ssl Context Parameters", "group": "security", "label": "common,security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "description": "SSL parameters to use, see SSLContextParameters class for all available options." },
     "useGlobalSslContextParameters": { "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters" },
     "userName": { "kind": "property", "displayName": "User Name", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Username used in OAuth flow to gain access to access token. It's easy to get started with password OAuth flow, but in general one should avoid it as it is deemed less secure than other flows." }
   },
   "headers": {
-    "CamelSalesforceReplayId": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The replay id.", "constantName": "org.apache.camel.component.salesforce.SalesforceConstants#HEADER_SALESFORCE_REPLAY_ID" },
+    "CamelSalesforceReplayId": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Streaming API replayId.", "constantName": "org.apache.camel.component.salesforce.SalesforceConstants#HEADER_SALESFORCE_REPLAY_ID" },
+    "CamelSalesforcePubSubReplayId": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Pub\/Sub API replayId.", "constantName": "org.apache.camel.component.salesforce.SalesforceConstants#HEADER_SALESFORCE_PUBSUB_REPLAY_ID" },
     "CamelSalesforceChangeEventSchema": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The change event schema.", "constantName": "org.apache.camel.component.salesforce.SalesforceConstants#HEADER_SALESFORCE_CHANGE_EVENT_SCHEMA" },
     "CamelSalesforceEventType": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The event type.", "constantName": "org.apache.camel.component.salesforce.SalesforceConstants#HEADER_SALESFORCE_EVENT_TYPE" },
     "CamelSalesforceCommitTimestamp": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The commit timestamp.", "constantName": "org.apache.camel.component.salesforce.SalesforceConstants#HEADER_SALESFORCE_COMMIT_TIMESTAMP" },
@@ -138,8 +145,8 @@
     "CamelSalesforceQueryResultTotalSize": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Total number of records matching a query.", "constantName": "org.apache.camel.component.salesforce.SalesforceConstants#HEADER_SALESFORCE_QUERY_RESULT_TOTAL_SIZE" }
   },
   "properties": {
-    "operationName": { "kind": "path", "displayName": "Operation Name", "group": "common", "label": "common", "required": true, "type": "object", "javaType": "org.apache.camel.component.salesforce.internal.OperationName", "enum": [ "getVersions", "getResources", "getGlobalObjects", "getBasicInfo", "getDescription", "getSObject", "createSObject", "updateSObject", "deleteSObject", "getSObjectWithId", "upsertSObject", "deleteSObjectWithId", "getBlobField", "query", "queryMore", "queryAll",  [...]
-    "topicName": { "kind": "path", "displayName": "Topic Name", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the topic\/channel to use" },
+    "operationName": { "kind": "path", "displayName": "Operation Name", "group": "common", "label": "common", "required": true, "type": "object", "javaType": "org.apache.camel.component.salesforce.internal.OperationName", "enum": [ "getVersions", "getResources", "getGlobalObjects", "getBasicInfo", "getDescription", "getSObject", "createSObject", "updateSObject", "deleteSObject", "getSObjectWithId", "upsertSObject", "deleteSObjectWithId", "getBlobField", "query", "queryMore", "queryAll",  [...]
+    "topicName": { "kind": "path", "displayName": "Topic Name", "group": "producer", "label": "consumer,producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the topic\/channel to use" },
     "apexMethod": { "kind": "parameter", "displayName": "Apex Method", "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": "configuration", "description": "APEX method name" },
     "apexQueryParams": { "kind": "parameter", "displayName": "Apex Query Params", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.salesforce.SalesforceEndpointConfig", "configurationField": "configuration", "description": "Query params for APEX method" },
     "apiVersion": { "kind": "parameter", "displayName": "Api Version", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "56.0", "configurationClass": "org.apache.camel.component.salesforce.SalesforceEndpointConfig", "configurationField": "configuration", "description": "Salesforce API version." },
@@ -186,7 +193,12 @@
     "sObjectSearch": { "kind": "parameter", "displayName": "SObject Search", "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": "configuration", "description": "Salesforce SOSL search string" },
     "streamQueryResult": { "kind": "parameter", "displayName": "Stream query result", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.salesforce.SalesforceEndpointConfig", "configurationField": "configuration", "description": "If true, streams SOQL query result and transparently handles subsequent reque [...]
     "updateTopic": { "kind": "parameter", "displayName": "Update Topic", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.salesforce.SalesforceEndpointConfig", "configurationField": "configuration", "description": "Whether to update an existing Push Topic when using the Streaming API, defaults to false" },
-    "replayId": { "kind": "parameter", "displayName": "Replay Id", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "The replayId value to use when subscribing" },
+    "pubSubBatchSize": { "kind": "parameter", "displayName": "Pub Sub Batch Size", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 100, "configurationClass": "org.apache.camel.component.salesforce.SalesforceEndpointConfig", "configurationField": "configuration", "description": "Max number of events to receive in a batch from the Pub\/Sub API." },
+    "pubSubDeserializeType": { "kind": "parameter", "displayName": "Pub Sub Deserialize Type", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.salesforce.PubSubDeserializeType", "enum": [ "AVRO", "SPECIFIC_RECORD", "GENERIC_RECORD", "POJO", "JSON" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "AVRO", "configurationClass": "org.apache.camel.component.salesforce.SalesforceEndpointConfig",  [...]
+    "pubSubPojoClass": { "kind": "parameter", "displayName": "Pub Sub Pojo Class", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.salesforce.SalesforceEndpointConfig", "configurationField": "configuration", "description": "Fully qualified class name to deserialize Pub\/Sub API event to." },
+    "pubSubReplayId": { "kind": "parameter", "displayName": "Pub Sub Replay Id", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The replayId value to use when subscribing to the Pub\/Sub API." },
+    "replayId": { "kind": "parameter", "displayName": "Replay Id", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "description": "The replayId value to use when subscribing to the Streaming API." },
+    "replayPreset": { "kind": "parameter", "displayName": "Replay Preset", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "com.salesforce.eventbus.protobuf.ReplayPreset", "enum": [ "LATEST", "EARLIEST", "CUSTOM" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "LATEST", "configurationClass": "org.apache.camel.component.salesforce.SalesforceEndpointConfig", "configurationField": "configuration", "description": "Replay [...]
     "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now [...]
     "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
     "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SalesforceComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SalesforceComponentBuilderFactory.java
index fab90b29e2c..c357d32b46a 100644
--- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SalesforceComponentBuilderFactory.java
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SalesforceComponentBuilderFactory.java
@@ -994,6 +994,71 @@ public interface SalesforceComponentBuilderFactory {
             doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
             return this;
         }
+        /**
+         * Max number of events to receive in a batch from the Pub/Sub API.
+         * 
+         * The option is a: &lt;code&gt;int&lt;/code&gt; type.
+         * 
+         * Default: 100
+         * Group: consumer
+         * 
+         * @param pubSubBatchSize the value to set
+         * @return the dsl builder
+         */
+        default SalesforceComponentBuilder pubSubBatchSize(int pubSubBatchSize) {
+            doSetProperty("pubSubBatchSize", pubSubBatchSize);
+            return this;
+        }
+        /**
+         * How to deserialize events consume from the Pub/Sub API. AVRO will try
+         * a SpecificRecord subclass if found, otherwise GenericRecord.
+         * 
+         * The option is a:
+         * &lt;code&gt;org.apache.camel.component.salesforce.PubSubDeserializeType&lt;/code&gt; type.
+         * 
+         * Default: AVRO
+         * Group: consumer
+         * 
+         * @param pubSubDeserializeType the value to set
+         * @return the dsl builder
+         */
+        default SalesforceComponentBuilder pubSubDeserializeType(
+                org.apache.camel.component.salesforce.PubSubDeserializeType pubSubDeserializeType) {
+            doSetProperty("pubSubDeserializeType", pubSubDeserializeType);
+            return this;
+        }
+        /**
+         * Fully qualified class name to deserialize Pub/Sub API event to.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: consumer
+         * 
+         * @param pubSubPojoClass the value to set
+         * @return the dsl builder
+         */
+        default SalesforceComponentBuilder pubSubPojoClass(
+                java.lang.String pubSubPojoClass) {
+            doSetProperty("pubSubPojoClass", pubSubPojoClass);
+            return this;
+        }
+        /**
+         * Replay preset for Pub/Sub API.
+         * 
+         * The option is a:
+         * &lt;code&gt;com.salesforce.eventbus.protobuf.ReplayPreset&lt;/code&gt; type.
+         * 
+         * Default: LATEST
+         * Group: consumer
+         * 
+         * @param replayPreset the value to set
+         * @return the dsl builder
+         */
+        default SalesforceComponentBuilder replayPreset(
+                com.salesforce.eventbus.protobuf.ReplayPreset replayPreset) {
+            doSetProperty("replayPreset", replayPreset);
+            return this;
+        }
         /**
          * Composite API option to indicate to rollback all records if any are
          * not successful.
@@ -1494,6 +1559,37 @@ public interface SalesforceComponentBuilderFactory {
             doSetProperty("password", password);
             return this;
         }
+        /**
+         * Pub/Sub host.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Default: api.pubsub.salesforce.com
+         * Group: security
+         * 
+         * @param pubSubHost the value to set
+         * @return the dsl builder
+         */
+        default SalesforceComponentBuilder pubSubHost(
+                java.lang.String pubSubHost) {
+            doSetProperty("pubSubHost", pubSubHost);
+            return this;
+        }
+        /**
+         * Pub/Sub port.
+         * 
+         * The option is a: &lt;code&gt;int&lt;/code&gt; type.
+         * 
+         * Default: 7443
+         * Group: security
+         * 
+         * @param pubSubPort the value to set
+         * @return the dsl builder
+         */
+        default SalesforceComponentBuilder pubSubPort(int pubSubPort) {
+            doSetProperty("pubSubPort", pubSubPort);
+            return this;
+        }
         /**
          * Refresh token already obtained in the refresh token OAuth flow. One
          * needs to setup a web application and configure a callback URL to
@@ -1647,6 +1743,10 @@ public interface SalesforceComponentBuilderFactory {
             case "workerPoolMaxSize": ((SalesforceComponent) component).setWorkerPoolMaxSize((int) value); return true;
             case "workerPoolSize": ((SalesforceComponent) component).setWorkerPoolSize((int) value); return true;
             case "bridgeErrorHandler": ((SalesforceComponent) component).setBridgeErrorHandler((boolean) value); return true;
+            case "pubSubBatchSize": getOrCreateConfiguration((SalesforceComponent) component).setPubSubBatchSize((int) value); return true;
+            case "pubSubDeserializeType": getOrCreateConfiguration((SalesforceComponent) component).setPubSubDeserializeType((org.apache.camel.component.salesforce.PubSubDeserializeType) value); return true;
+            case "pubSubPojoClass": getOrCreateConfiguration((SalesforceComponent) component).setPubSubPojoClass((java.lang.String) value); return true;
+            case "replayPreset": getOrCreateConfiguration((SalesforceComponent) component).setReplayPreset((com.salesforce.eventbus.protobuf.ReplayPreset) value); return true;
             case "allOrNone": getOrCreateConfiguration((SalesforceComponent) component).setAllOrNone((boolean) value); return true;
             case "apexUrl": getOrCreateConfiguration((SalesforceComponent) component).setApexUrl((java.lang.String) value); return true;
             case "compositeMethod": getOrCreateConfiguration((SalesforceComponent) component).setCompositeMethod((java.lang.String) value); return true;
@@ -1677,6 +1777,8 @@ public interface SalesforceComponentBuilderFactory {
             case "loginConfig": ((SalesforceComponent) component).setLoginConfig((org.apache.camel.component.salesforce.SalesforceLoginConfig) value); return true;
             case "loginUrl": ((SalesforceComponent) component).setLoginUrl((java.lang.String) value); return true;
             case "password": ((SalesforceComponent) component).setPassword((java.lang.String) value); return true;
+            case "pubSubHost": ((SalesforceComponent) component).setPubSubHost((java.lang.String) value); return true;
+            case "pubSubPort": ((SalesforceComponent) component).setPubSubPort((int) value); return true;
             case "refreshToken": ((SalesforceComponent) component).setRefreshToken((java.lang.String) value); return true;
             case "sslContextParameters": ((SalesforceComponent) component).setSslContextParameters((org.apache.camel.support.jsse.SSLContextParameters) value); return true;
             case "useGlobalSslContextParameters": ((SalesforceComponent) component).setUseGlobalSslContextParameters((boolean) value); return true;
diff --git a/dsl/camel-componentdsl/src/generated/resources/metadata.json b/dsl/camel-componentdsl/src/generated/resources/metadata.json
index cc3d0507ad4..fbc55a05887 100644
--- a/dsl/camel-componentdsl/src/generated/resources/metadata.json
+++ b/dsl/camel-componentdsl/src/generated/resources/metadata.json
@@ -2595,7 +2595,7 @@
     "api": false,
     "consumerOnly": false,
     "producerOnly": true,
-    "lenientProperties": false
+    "lenientProperties": true
   },
   "GrpcComponentBuilderFactory": {
     "kind": "component",
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
index 8166bba3ad2..e8d0401a87a 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
@@ -11892,7 +11892,7 @@ public class StaticEndpointBuilders {
      * 
      * Path parameter: operationName (required)
      * The operation to use
-     * There are 66 enums and the value can be one of: getVersions,
+     * There are 68 enums and the value can be one of: getVersions,
      * getResources, getGlobalObjects, getBasicInfo, getDescription, getSObject,
      * createSObject, updateSObject, deleteSObject, getSObjectWithId,
      * upsertSObject, deleteSObjectWithId, getBlobField, query, queryMore,
@@ -11909,7 +11909,7 @@ public class StaticEndpointBuilders {
      * bulk2DeleteJob, bulk2GetSuccessfulResults, bulk2GetFailedResults,
      * bulk2GetUnprocessedRecords, bulk2CreateQueryJob, bulk2GetQueryJob,
      * bulk2GetAllQueryJobs, bulk2GetQueryJobResults, bulk2AbortQueryJob,
-     * bulk2DeleteQueryJob, raw, subscribe
+     * bulk2DeleteQueryJob, raw, subscribe, pubSubSubscribe, pubSubPublish
      * 
      * Path parameter: topicName
      * The name of the topic/channel to use
@@ -11933,7 +11933,7 @@ public class StaticEndpointBuilders {
      * 
      * Path parameter: operationName (required)
      * The operation to use
-     * There are 66 enums and the value can be one of: getVersions,
+     * There are 68 enums and the value can be one of: getVersions,
      * getResources, getGlobalObjects, getBasicInfo, getDescription, getSObject,
      * createSObject, updateSObject, deleteSObject, getSObjectWithId,
      * upsertSObject, deleteSObjectWithId, getBlobField, query, queryMore,
@@ -11950,7 +11950,7 @@ public class StaticEndpointBuilders {
      * bulk2DeleteJob, bulk2GetSuccessfulResults, bulk2GetFailedResults,
      * bulk2GetUnprocessedRecords, bulk2CreateQueryJob, bulk2GetQueryJob,
      * bulk2GetAllQueryJobs, bulk2GetQueryJobResults, bulk2AbortQueryJob,
-     * bulk2DeleteQueryJob, raw, subscribe
+     * bulk2DeleteQueryJob, raw, subscribe, pubSubSubscribe, pubSubPublish
      * 
      * Path parameter: topicName
      * The name of the topic/channel to use
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SalesforceEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SalesforceEndpointBuilderFactory.java
index 1e7f83a5612..262164ae678 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SalesforceEndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SalesforceEndpointBuilderFactory.java
@@ -1220,7 +1220,105 @@ public interface SalesforceEndpointBuilderFactory {
             return this;
         }
         /**
-         * The replayId value to use when subscribing.
+         * Max number of events to receive in a batch from the Pub/Sub API.
+         * 
+         * The option is a: &lt;code&gt;int&lt;/code&gt; type.
+         * 
+         * Default: 100
+         * Group: consumer
+         * 
+         * @param pubSubBatchSize the value to set
+         * @return the dsl builder
+         */
+        default SalesforceEndpointConsumerBuilder pubSubBatchSize(
+                int pubSubBatchSize) {
+            doSetProperty("pubSubBatchSize", pubSubBatchSize);
+            return this;
+        }
+        /**
+         * Max number of events to receive in a batch from the Pub/Sub API.
+         * 
+         * The option will be converted to a &lt;code&gt;int&lt;/code&gt; type.
+         * 
+         * Default: 100
+         * Group: consumer
+         * 
+         * @param pubSubBatchSize the value to set
+         * @return the dsl builder
+         */
+        default SalesforceEndpointConsumerBuilder pubSubBatchSize(
+                String pubSubBatchSize) {
+            doSetProperty("pubSubBatchSize", pubSubBatchSize);
+            return this;
+        }
+        /**
+         * How to deserialize events consume from the Pub/Sub API. AVRO will try
+         * a SpecificRecord subclass if found, otherwise GenericRecord.
+         * 
+         * The option is a:
+         * &lt;code&gt;org.apache.camel.component.salesforce.PubSubDeserializeType&lt;/code&gt; type.
+         * 
+         * Default: AVRO
+         * Group: consumer
+         * 
+         * @param pubSubDeserializeType the value to set
+         * @return the dsl builder
+         */
+        default SalesforceEndpointConsumerBuilder pubSubDeserializeType(
+                org.apache.camel.component.salesforce.PubSubDeserializeType pubSubDeserializeType) {
+            doSetProperty("pubSubDeserializeType", pubSubDeserializeType);
+            return this;
+        }
+        /**
+         * How to deserialize events consume from the Pub/Sub API. AVRO will try
+         * a SpecificRecord subclass if found, otherwise GenericRecord.
+         * 
+         * The option will be converted to a
+         * &lt;code&gt;org.apache.camel.component.salesforce.PubSubDeserializeType&lt;/code&gt; type.
+         * 
+         * Default: AVRO
+         * Group: consumer
+         * 
+         * @param pubSubDeserializeType the value to set
+         * @return the dsl builder
+         */
+        default SalesforceEndpointConsumerBuilder pubSubDeserializeType(
+                String pubSubDeserializeType) {
+            doSetProperty("pubSubDeserializeType", pubSubDeserializeType);
+            return this;
+        }
+        /**
+         * Fully qualified class name to deserialize Pub/Sub API event to.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: consumer
+         * 
+         * @param pubSubPojoClass the value to set
+         * @return the dsl builder
+         */
+        default SalesforceEndpointConsumerBuilder pubSubPojoClass(
+                String pubSubPojoClass) {
+            doSetProperty("pubSubPojoClass", pubSubPojoClass);
+            return this;
+        }
+        /**
+         * The replayId value to use when subscribing to the Pub/Sub API.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: consumer
+         * 
+         * @param pubSubReplayId the value to set
+         * @return the dsl builder
+         */
+        default SalesforceEndpointConsumerBuilder pubSubReplayId(
+                String pubSubReplayId) {
+            doSetProperty("pubSubReplayId", pubSubReplayId);
+            return this;
+        }
+        /**
+         * The replayId value to use when subscribing to the Streaming API.
          * 
          * The option is a: &lt;code&gt;java.lang.Long&lt;/code&gt; type.
          * 
@@ -1234,7 +1332,7 @@ public interface SalesforceEndpointBuilderFactory {
             return this;
         }
         /**
-         * The replayId value to use when subscribing.
+         * The replayId value to use when subscribing to the Streaming API.
          * 
          * The option will be converted to a
          * &lt;code&gt;java.lang.Long&lt;/code&gt; type.
@@ -1248,6 +1346,40 @@ public interface SalesforceEndpointBuilderFactory {
             doSetProperty("replayId", replayId);
             return this;
         }
+        /**
+         * Replay preset for Pub/Sub API.
+         * 
+         * The option is a:
+         * &lt;code&gt;com.salesforce.eventbus.protobuf.ReplayPreset&lt;/code&gt; type.
+         * 
+         * Default: LATEST
+         * Group: consumer
+         * 
+         * @param replayPreset the value to set
+         * @return the dsl builder
+         */
+        default SalesforceEndpointConsumerBuilder replayPreset(
+                com.salesforce.eventbus.protobuf.ReplayPreset replayPreset) {
+            doSetProperty("replayPreset", replayPreset);
+            return this;
+        }
+        /**
+         * Replay preset for Pub/Sub API.
+         * 
+         * The option will be converted to a
+         * &lt;code&gt;com.salesforce.eventbus.protobuf.ReplayPreset&lt;/code&gt; type.
+         * 
+         * Default: LATEST
+         * Group: consumer
+         * 
+         * @param replayPreset the value to set
+         * @return the dsl builder
+         */
+        default SalesforceEndpointConsumerBuilder replayPreset(
+                String replayPreset) {
+            doSetProperty("replayPreset", replayPreset);
+            return this;
+        }
     }
 
     /**
@@ -3955,7 +4087,7 @@ public interface SalesforceEndpointBuilderFactory {
          * 
          * Path parameter: operationName (required)
          * The operation to use
-         * There are 66 enums and the value can be one of: getVersions,
+         * There are 68 enums and the value can be one of: getVersions,
          * getResources, getGlobalObjects, getBasicInfo, getDescription,
          * getSObject, createSObject, updateSObject, deleteSObject,
          * getSObjectWithId, upsertSObject, deleteSObjectWithId, getBlobField,
@@ -3973,7 +4105,7 @@ public interface SalesforceEndpointBuilderFactory {
          * bulk2GetSuccessfulResults, bulk2GetFailedResults,
          * bulk2GetUnprocessedRecords, bulk2CreateQueryJob, bulk2GetQueryJob,
          * bulk2GetAllQueryJobs, bulk2GetQueryJobResults, bulk2AbortQueryJob,
-         * bulk2DeleteQueryJob, raw, subscribe
+         * bulk2DeleteQueryJob, raw, subscribe, pubSubSubscribe, pubSubPublish
          * 
          * Path parameter: topicName
          * The name of the topic/channel to use
@@ -3996,7 +4128,7 @@ public interface SalesforceEndpointBuilderFactory {
          * 
          * Path parameter: operationName (required)
          * The operation to use
-         * There are 66 enums and the value can be one of: getVersions,
+         * There are 68 enums and the value can be one of: getVersions,
          * getResources, getGlobalObjects, getBasicInfo, getDescription,
          * getSObject, createSObject, updateSObject, deleteSObject,
          * getSObjectWithId, upsertSObject, deleteSObjectWithId, getBlobField,
@@ -4014,7 +4146,7 @@ public interface SalesforceEndpointBuilderFactory {
          * bulk2GetSuccessfulResults, bulk2GetFailedResults,
          * bulk2GetUnprocessedRecords, bulk2CreateQueryJob, bulk2GetQueryJob,
          * bulk2GetAllQueryJobs, bulk2GetQueryJobResults, bulk2AbortQueryJob,
-         * bulk2DeleteQueryJob, raw, subscribe
+         * bulk2DeleteQueryJob, raw, subscribe, pubSubSubscribe, pubSubPublish
          * 
          * Path parameter: topicName
          * The name of the topic/channel to use
@@ -4042,7 +4174,7 @@ public interface SalesforceEndpointBuilderFactory {
         private static final SalesforceHeaderNameBuilder INSTANCE = new SalesforceHeaderNameBuilder();
 
         /**
-         * The replay id.
+         * The Streaming API replayId.
          * 
          * The option is a: {@code Object} type.
          * 
@@ -4054,6 +4186,19 @@ public interface SalesforceEndpointBuilderFactory {
             return "SalesforceReplayId";
         }
 
+        /**
+         * The Pub/Sub API replayId.
+         * 
+         * The option is a: {@code Object} type.
+         * 
+         * Group: consumer
+         * 
+         * @return the name of the header {@code SalesforcePubSubReplayId}.
+         */
+        public String salesforcePubSubReplayId() {
+            return "SalesforcePubSubReplayId";
+        }
+
         /**
          * The change event schema.
          * 


[camel] 01/02: [CAMEL-19188] Make GraphQL component lenient (#9655)

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

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

commit c6809b2345765b1aa2cd4372b99c7ef69fff19c3
Author: Felix Hoßfeld <80...@users.noreply.github.com>
AuthorDate: Mon Mar 27 20:46:43 2023 +0200

    [CAMEL-19188] Make GraphQL component lenient (#9655)
    
    * Make GraphQL component lenient to support additional query parameters passed to the HTTP endpoints (CAMEL-19188)
    
    * Fixed order of the imports.
---
 .../graphql/GraphqlEndpointUriFactory.java         |  2 +-
 .../apache/camel/component/graphql/graphql.json    |  2 +-
 .../camel/component/graphql/GraphqlComponent.java  | 12 +++++++++++
 .../camel/component/graphql/GraphqlEndpoint.java   |  7 ++++++-
 .../component/graphql/GraphqlComponentTest.java    | 23 ++++++++++++++++++++++
 5 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/components/camel-graphql/src/generated/java/org/apache/camel/component/graphql/GraphqlEndpointUriFactory.java b/components/camel-graphql/src/generated/java/org/apache/camel/component/graphql/GraphqlEndpointUriFactory.java
index 5bf38618f74..68926589131 100644
--- a/components/camel-graphql/src/generated/java/org/apache/camel/component/graphql/GraphqlEndpointUriFactory.java
+++ b/components/camel-graphql/src/generated/java/org/apache/camel/component/graphql/GraphqlEndpointUriFactory.java
@@ -78,7 +78,7 @@ public class GraphqlEndpointUriFactory extends org.apache.camel.support.componen
 
     @Override
     public boolean isLenientProperties() {
-        return false;
+        return true;
     }
 }
 
diff --git a/components/camel-graphql/src/generated/resources/org/apache/camel/component/graphql/graphql.json b/components/camel-graphql/src/generated/resources/org/apache/camel/component/graphql/graphql.json
index 5efbcb8c13d..55a2f26cbf0 100644
--- a/components/camel-graphql/src/generated/resources/org/apache/camel/component/graphql/graphql.json
+++ b/components/camel-graphql/src/generated/resources/org/apache/camel/component/graphql/graphql.json
@@ -19,7 +19,7 @@
     "api": false,
     "consumerOnly": false,
     "producerOnly": true,
-    "lenientProperties": false
+    "lenientProperties": true
   },
   "componentProperties": {
     "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 [...]
diff --git a/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlComponent.java b/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlComponent.java
index 4d346cda6bc..605a08b0408 100644
--- a/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlComponent.java
+++ b/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlComponent.java
@@ -22,6 +22,7 @@ import java.util.Map;
 import org.apache.camel.Endpoint;
 import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.support.DefaultComponent;
+import org.apache.camel.util.URISupport;
 
 @Component("graphql")
 public class GraphqlComponent extends DefaultComponent {
@@ -34,4 +35,15 @@ public class GraphqlComponent extends DefaultComponent {
         return endpoint;
     }
 
+    @Override
+    protected void afterConfiguration(String uri, String remaining, Endpoint endpoint, Map<String, Object> parameters)
+            throws Exception {
+
+        GraphqlEndpoint graphqlEndpoint = (GraphqlEndpoint) endpoint;
+        if (!parameters.isEmpty()) {
+            URI httpUri = URISupport.createRemainingURI(graphqlEndpoint.getHttpUri(), parameters);
+            graphqlEndpoint.setHttpUri(httpUri);
+        }
+    }
+
 }
diff --git a/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlEndpoint.java b/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlEndpoint.java
index 80869870fc8..d28dd044f73 100644
--- a/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlEndpoint.java
+++ b/components/camel-graphql/src/main/java/org/apache/camel/component/graphql/GraphqlEndpoint.java
@@ -49,7 +49,7 @@ import org.apache.hc.core5.http.message.BasicHeader;
  * Send GraphQL queries and mutations to external systems.
  */
 @UriEndpoint(firstVersion = "3.0.0", scheme = "graphql", title = "GraphQL", syntax = "graphql:httpUri",
-             category = { Category.API }, producerOnly = true)
+             category = { Category.API }, producerOnly = true, lenientProperties = true)
 public class GraphqlEndpoint extends DefaultEndpoint {
 
     @UriPath
@@ -280,4 +280,9 @@ public class GraphqlEndpoint extends DefaultEndpoint {
     public void setHttpClient(CloseableHttpClient httpClient) {
         this.httpClient = httpClient;
     }
+
+    @Override
+    public boolean isLenientProperties() {
+        return true;
+    }
 }
diff --git a/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/GraphqlComponentTest.java b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/GraphqlComponentTest.java
index 11b6ed4db27..24cff92c41a 100644
--- a/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/GraphqlComponentTest.java
+++ b/components/camel-graphql/src/test/java/org/apache/camel/component/graphql/GraphqlComponentTest.java
@@ -17,6 +17,7 @@
 package org.apache.camel.component.graphql;
 
 import java.io.IOException;
+import java.net.URI;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.camel.BindToRegistry;
@@ -32,6 +33,8 @@ import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 public class GraphqlComponentTest extends CamelTestSupport {
 
     private static String booksQueryResult;
@@ -112,6 +115,9 @@ public class GraphqlComponentTest extends CamelTestSupport {
                         .to("graphql://http://localhost:" + server.getPort()
                             + "/graphql?queryHeader=myQuery")
                         .to("mock:result");
+                from("direct:start8")
+                        .to("graphql://http://localhost:" + server.getPort() + "/graphql?apikey=123456&query={books{id name}}")
+                        .to("mock:result");
             }
         };
     }
@@ -199,4 +205,21 @@ public class GraphqlComponentTest extends CamelTestSupport {
 
         result.assertIsSatisfied();
     }
+
+    @Test
+    public void checkApiKey() throws Exception {
+
+        GraphqlEndpoint graphqlEndpoint = (GraphqlEndpoint) template.getCamelContext().getEndpoint(
+                "graphql://http://localhost:" + server.getPort() + "/graphql?apikey=123456&query={books{id name}}");
+        URI httpUri = graphqlEndpoint.getHttpUri();
+        assertEquals("apikey=123456", httpUri.getQuery());
+
+        result.expectedMessageCount(1);
+        result.expectedBodiesReceived(booksQueryResult);
+
+        template.sendBody("direct:start8", "");
+
+        result.assertIsSatisfied();
+
+    }
 }