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 2021/03/04 08:50:38 UTC

[camel] branch master updated (d0c1dab -> ae92dee)

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

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


    from d0c1dab  CAMEL-16273 - Camel-google-* cloud components: Make the serviceAccountKey explicitly configurable - Camel-google-pubsub - Improved endpoint options description
     new 449a8ad  CAMEL-16273 - Camel-google-* cloud components: Make the serviceAccountKey explicitly configurable - Camel-google-pubsub, add service account key at component level
     new 5bd2b54  CAMEL-16273 - Camel-google-* cloud components: Make the serviceAccountKey explicitly configurable - Camel-google-pubsub, add service account key at component level
     new ae92dee  CAMEL-16273 - Camel-google-* cloud components: Make the serviceAccountKey explicitly configurable - Camel-google-pubsub, add service account key at component level

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


Summary of changes:
 .../camel/catalog/components/google-pubsub.json       |  1 +
 .../camel/catalog/docs/google-pubsub-component.adoc   |  3 ++-
 .../pubsub/GooglePubsubComponentConfigurer.java       |  6 ++++++
 .../camel/component/google/pubsub/google-pubsub.json  |  1 +
 .../src/main/docs/google-pubsub-component.adoc        |  3 ++-
 .../google/pubsub/GooglePubsubComponent.java          | 15 +++++++++++++++
 .../dsl/GooglePubsubComponentBuilderFactory.java      | 19 +++++++++++++++++++
 .../modules/ROOT/pages/google-pubsub-component.adoc   |  3 ++-
 8 files changed, 48 insertions(+), 3 deletions(-)


[camel] 02/03: CAMEL-16273 - Camel-google-* cloud components: Make the serviceAccountKey explicitly configurable - Camel-google-pubsub, add service account key at component level

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

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

commit 5bd2b5412ff2117f1334cbfe08453a9a20eb2da0
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 4 09:32:31 2021 +0100

    CAMEL-16273 - Camel-google-* cloud components: Make the serviceAccountKey explicitly configurable - Camel-google-pubsub, add service account key at component level
---
 .../camel/catalog/docs/google-pubsub-component.adoc   |  3 ++-
 .../pubsub/GooglePubsubComponentConfigurer.java       |  6 ++++++
 .../camel/component/google/pubsub/google-pubsub.json  |  1 +
 .../src/main/docs/google-pubsub-component.adoc        |  3 ++-
 .../google/pubsub/GooglePubsubComponent.java          |  4 ++--
 .../dsl/GooglePubsubComponentBuilderFactory.java      | 19 +++++++++++++++++++
 .../modules/ROOT/pages/google-pubsub-component.adoc   |  3 ++-
 7 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-pubsub-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-pubsub-component.adoc
index 2d81f33..0927c89 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-pubsub-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-pubsub-component.adoc
@@ -44,7 +44,7 @@ Destination Name can be either a topic or a subscription name.
 == Options
 
 // component options: START
-The Google Pubsub component supports 7 options, which are listed below.
+The Google Pubsub component supports 8 options, which are listed below.
 
 
 
@@ -52,6 +52,7 @@ The Google Pubsub component supports 7 options, which are listed below.
 |===
 | Name | Description | Default | Type
 | *endpoint* (common) | Endpoint to use with local Pub/Sub emulator. |  | String
+| *serviceAccountKey* (common) | *Required* The Service account key that can be used as credentials for the PubSub publisher/subscriber. It can be loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems. |  | String
 | *bridgeErrorHandler* (consumer) | 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 message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | 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 [...]
 | *publisherCacheSize* (producer) | Maximum number of producers to cache. This could be increased if you have producers for lots of different topics. |  | int
diff --git a/components/camel-google-pubsub/src/generated/java/org/apache/camel/component/google/pubsub/GooglePubsubComponentConfigurer.java b/components/camel-google-pubsub/src/generated/java/org/apache/camel/component/google/pubsub/GooglePubsubComponentConfigurer.java
index f9f5e77..ad90ef3 100644
--- a/components/camel-google-pubsub/src/generated/java/org/apache/camel/component/google/pubsub/GooglePubsubComponentConfigurer.java
+++ b/components/camel-google-pubsub/src/generated/java/org/apache/camel/component/google/pubsub/GooglePubsubComponentConfigurer.java
@@ -34,6 +34,8 @@ public class GooglePubsubComponentConfigurer extends PropertyConfigurerSupport i
         case "publisherCacheTimeout": target.setPublisherCacheTimeout(property(camelContext, int.class, value)); return true;
         case "publisherterminationtimeout":
         case "publisherTerminationTimeout": target.setPublisherTerminationTimeout(property(camelContext, int.class, value)); return true;
+        case "serviceaccountkey":
+        case "serviceAccountKey": target.setServiceAccountKey(property(camelContext, java.lang.String.class, value)); return true;
         default: return false;
         }
     }
@@ -54,6 +56,8 @@ public class GooglePubsubComponentConfigurer extends PropertyConfigurerSupport i
         case "publisherCacheTimeout": return int.class;
         case "publisherterminationtimeout":
         case "publisherTerminationTimeout": return int.class;
+        case "serviceaccountkey":
+        case "serviceAccountKey": return java.lang.String.class;
         default: return null;
         }
     }
@@ -75,6 +79,8 @@ public class GooglePubsubComponentConfigurer extends PropertyConfigurerSupport i
         case "publisherCacheTimeout": return target.getPublisherCacheTimeout();
         case "publisherterminationtimeout":
         case "publisherTerminationTimeout": return target.getPublisherTerminationTimeout();
+        case "serviceaccountkey":
+        case "serviceAccountKey": return target.getServiceAccountKey();
         default: return null;
         }
     }
diff --git a/components/camel-google-pubsub/src/generated/resources/org/apache/camel/component/google/pubsub/google-pubsub.json b/components/camel-google-pubsub/src/generated/resources/org/apache/camel/component/google/pubsub/google-pubsub.json
index c731e37..5734a1a 100644
--- a/components/camel-google-pubsub/src/generated/resources/org/apache/camel/component/google/pubsub/google-pubsub.json
+++ b/components/camel-google-pubsub/src/generated/resources/org/apache/camel/component/google/pubsub/google-pubsub.json
@@ -23,6 +23,7 @@
   },
   "componentProperties": {
     "endpoint": { "kind": "property", "displayName": "Endpoint", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Endpoint to use with local Pub\/Sub emulator." },
+    "serviceAccountKey": { "kind": "property", "displayName": "Service Account Key", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Service account key that can be used as credentials for the PubSub publisher\/subscriber. It can be loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different s [...]
     "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 [...]
     "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 [...]
     "publisherCacheSize": { "kind": "property", "displayName": "Publisher Cache Size", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "Maximum number of producers to cache. This could be increased if you have producers for lots of different topics." },
diff --git a/components/camel-google-pubsub/src/main/docs/google-pubsub-component.adoc b/components/camel-google-pubsub/src/main/docs/google-pubsub-component.adoc
index 2d81f33..0927c89 100644
--- a/components/camel-google-pubsub/src/main/docs/google-pubsub-component.adoc
+++ b/components/camel-google-pubsub/src/main/docs/google-pubsub-component.adoc
@@ -44,7 +44,7 @@ Destination Name can be either a topic or a subscription name.
 == Options
 
 // component options: START
-The Google Pubsub component supports 7 options, which are listed below.
+The Google Pubsub component supports 8 options, which are listed below.
 
 
 
@@ -52,6 +52,7 @@ The Google Pubsub component supports 7 options, which are listed below.
 |===
 | Name | Description | Default | Type
 | *endpoint* (common) | Endpoint to use with local Pub/Sub emulator. |  | String
+| *serviceAccountKey* (common) | *Required* The Service account key that can be used as credentials for the PubSub publisher/subscriber. It can be loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems. |  | String
 | *bridgeErrorHandler* (consumer) | 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 message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | 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 [...]
 | *publisherCacheSize* (producer) | Maximum number of producers to cache. This could be increased if you have producers for lots of different topics. |  | int
diff --git a/components/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubComponent.java b/components/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubComponent.java
index c0442b4..bcc7c32 100644
--- a/components/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubComponent.java
+++ b/components/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubComponent.java
@@ -63,8 +63,8 @@ public class GooglePubsubComponent extends DefaultComponent {
 
     @Metadata(label = "common",
               description = "The Service account key that can be used as credentials for the PubSub publisher/subscriber. It can be loaded by default from "
-                  + " classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems.",
-                  required = true)
+                            + " classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems.",
+              required = true)
     private String serviceAccountKey;
 
     @Metadata(
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GooglePubsubComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GooglePubsubComponentBuilderFactory.java
index 90b6e4a..0020696 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GooglePubsubComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GooglePubsubComponentBuilderFactory.java
@@ -65,6 +65,24 @@ public interface GooglePubsubComponentBuilderFactory {
             return this;
         }
         /**
+         * The Service account key that can be used as credentials for the
+         * PubSub publisher/subscriber. It can be loaded by default from
+         * classpath, but you can prefix with classpath:, file:, or http: to
+         * load the resource from different systems.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: common
+         * 
+         * @param serviceAccountKey the value to set
+         * @return the dsl builder
+         */
+        default GooglePubsubComponentBuilder serviceAccountKey(
+                java.lang.String serviceAccountKey) {
+            doSetProperty("serviceAccountKey", serviceAccountKey);
+            return this;
+        }
+        /**
          * 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
@@ -195,6 +213,7 @@ public interface GooglePubsubComponentBuilderFactory {
                 Object value) {
             switch (name) {
             case "endpoint": ((GooglePubsubComponent) component).setEndpoint((java.lang.String) value); return true;
+            case "serviceAccountKey": ((GooglePubsubComponent) component).setServiceAccountKey((java.lang.String) value); return true;
             case "bridgeErrorHandler": ((GooglePubsubComponent) component).setBridgeErrorHandler((boolean) value); return true;
             case "lazyStartProducer": ((GooglePubsubComponent) component).setLazyStartProducer((boolean) value); return true;
             case "publisherCacheSize": ((GooglePubsubComponent) component).setPublisherCacheSize((int) value); return true;
diff --git a/docs/components/modules/ROOT/pages/google-pubsub-component.adoc b/docs/components/modules/ROOT/pages/google-pubsub-component.adoc
index 7164c2c..38f69d7 100644
--- a/docs/components/modules/ROOT/pages/google-pubsub-component.adoc
+++ b/docs/components/modules/ROOT/pages/google-pubsub-component.adoc
@@ -46,7 +46,7 @@ Destination Name can be either a topic or a subscription name.
 == Options
 
 // component options: START
-The Google Pubsub component supports 7 options, which are listed below.
+The Google Pubsub component supports 8 options, which are listed below.
 
 
 
@@ -54,6 +54,7 @@ The Google Pubsub component supports 7 options, which are listed below.
 |===
 | Name | Description | Default | Type
 | *endpoint* (common) | Endpoint to use with local Pub/Sub emulator. |  | String
+| *serviceAccountKey* (common) | *Required* The Service account key that can be used as credentials for the PubSub publisher/subscriber. It can be loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems. |  | String
 | *bridgeErrorHandler* (consumer) | 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 message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | 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 [...]
 | *publisherCacheSize* (producer) | Maximum number of producers to cache. This could be increased if you have producers for lots of different topics. |  | int


[camel] 03/03: CAMEL-16273 - Camel-google-* cloud components: Make the serviceAccountKey explicitly configurable - Camel-google-pubsub, add service account key at component level

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

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

commit ae92deeb2bcb47551443bd215c12a98fb618ec79
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 4 09:46:07 2021 +0100

    CAMEL-16273 - Camel-google-* cloud components: Make the serviceAccountKey explicitly configurable - Camel-google-pubsub, add service account key at component level
---
 .../resources/org/apache/camel/catalog/components/google-pubsub.json     | 1 +
 1 file changed, 1 insertion(+)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/google-pubsub.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/google-pubsub.json
index c731e37..5734a1a 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/google-pubsub.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/google-pubsub.json
@@ -23,6 +23,7 @@
   },
   "componentProperties": {
     "endpoint": { "kind": "property", "displayName": "Endpoint", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Endpoint to use with local Pub\/Sub emulator." },
+    "serviceAccountKey": { "kind": "property", "displayName": "Service Account Key", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The Service account key that can be used as credentials for the PubSub publisher\/subscriber. It can be loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different s [...]
     "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 [...]
     "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 [...]
     "publisherCacheSize": { "kind": "property", "displayName": "Publisher Cache Size", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "Maximum number of producers to cache. This could be increased if you have producers for lots of different topics." },


[camel] 01/03: CAMEL-16273 - Camel-google-* cloud components: Make the serviceAccountKey explicitly configurable - Camel-google-pubsub, add service account key at component level

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

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

commit 449a8adcd8552b69c74ae0ac4e5eb6f7857f5eb9
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Mar 4 09:30:44 2021 +0100

    CAMEL-16273 - Camel-google-* cloud components: Make the serviceAccountKey explicitly configurable - Camel-google-pubsub, add service account key at component level
---
 .../component/google/pubsub/GooglePubsubComponent.java    | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/components/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubComponent.java b/components/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubComponent.java
index dbc2aca..c0442b4 100644
--- a/components/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubComponent.java
+++ b/components/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubComponent.java
@@ -61,6 +61,12 @@ public class GooglePubsubComponent extends DefaultComponent {
               description = "Endpoint to use with local Pub/Sub emulator.")
     private String endpoint;
 
+    @Metadata(label = "common",
+              description = "The Service account key that can be used as credentials for the PubSub publisher/subscriber. It can be loaded by default from "
+                  + " classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems.",
+                  required = true)
+    private String serviceAccountKey;
+
     @Metadata(
               label = "producer",
               description = "Maximum number of producers to cache. This could be increased if you have producers for lots of different topics.")
@@ -111,6 +117,7 @@ public class GooglePubsubComponent extends DefaultComponent {
         GooglePubsubEndpoint pubsubEndpoint = new GooglePubsubEndpoint(uri, this, remaining);
         pubsubEndpoint.setProjectId(parts[0]);
         pubsubEndpoint.setDestinationName(parts[1]);
+        pubsubEndpoint.setServiceAccountKey(serviceAccountKey);
 
         setProperties(pubsubEndpoint, parameters);
 
@@ -234,4 +241,12 @@ public class GooglePubsubComponent extends DefaultComponent {
     public void setPublisherTerminationTimeout(int publisherTerminationTimeout) {
         this.publisherTerminationTimeout = publisherTerminationTimeout;
     }
+
+    public String getServiceAccountKey() {
+        return serviceAccountKey;
+    }
+
+    public void setServiceAccountKey(String serviceAccountKey) {
+        this.serviceAccountKey = serviceAccountKey;
+    }
 }