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 2020/02/28 15:58:03 UTC

[camel] branch master updated (29a59cd -> 2200e00)

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 29a59cd  CAMEL-11807: Migrated camel-johnzon tests to JUnit 5
     new 3656c41  CAMEL-14568 - Fixed AWS SES
     new 86b1333  CAMEL-14568 - Fixed AWS SNS
     new f979f7c  CAMEL-14568 - Fixed AWS SQS
     new 2200e00  CAMEL-14568 - Fixed AWS SWF

The 4 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:
 .../component/aws/ses/SesComponentConfigurer.java  | 11 ++-
 .../apache/camel/component/aws/ses/aws-ses.json    |  6 +-
 .../src/main/docs/aws-ses-component.adoc           |  6 +-
 .../camel/component/aws/ses/SesComponent.java      | 46 +------------
 .../aws/ses/SesComponentConfigurationTest.java     | 16 ++---
 .../component/aws/sns/SnsComponentConfigurer.java  | 11 ++-
 .../apache/camel/component/aws/sns/aws-sns.json    |  6 +-
 .../src/main/docs/aws-sns-component.adoc           |  6 +-
 .../camel/component/aws/sns/SnsComponent.java      | 49 +-------------
 .../aws/sns/SnsComponentConfigurationTest.java     | 22 +++---
 .../component/aws/sqs/SqsComponentConfigurer.java  | 11 ++-
 .../apache/camel/component/aws/sqs/aws-sqs.json    |  8 +--
 .../src/main/docs/aws-sqs-component.adoc           |  6 +-
 .../camel/component/aws/sqs/SqsComponent.java      | 47 +------------
 .../aws/sqs/SqsComponentConfigurationTest.java     | 22 +++---
 .../component/aws/swf/SWFComponentConfigurer.java  | 11 ++-
 .../apache/camel/component/aws/swf/aws-swf.json    |  8 +--
 .../src/main/docs/aws-swf-component.adoc           |  6 +-
 .../camel/component/aws/swf/SWFComponent.java      | 46 +------------
 .../aws/swf/SWFComponentConfigurationTest.java     | 10 +--
 .../dsl/AwsSesComponentBuilderFactory.java         | 62 ++++++++---------
 .../dsl/AwsSnsComponentBuilderFactory.java         | 66 +++++++++---------
 .../dsl/AwsSqsComponentBuilderFactory.java         | 78 +++++++++++-----------
 .../dsl/AwsSwfComponentBuilderFactory.java         | 74 ++++++++++----------
 24 files changed, 230 insertions(+), 404 deletions(-)


[camel] 01/04: CAMEL-14568 - Fixed AWS SES

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 3656c41c0b4a291518615a03789bd9110c470bf3
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Feb 28 16:42:53 2020 +0100

    CAMEL-14568 - Fixed AWS SES
---
 .../component/aws/ses/SesComponentConfigurer.java  | 11 ++--
 .../apache/camel/component/aws/ses/aws-ses.json    |  6 +--
 .../src/main/docs/aws-ses-component.adoc           |  6 +--
 .../camel/component/aws/ses/SesComponent.java      | 46 +---------------
 .../aws/ses/SesComponentConfigurationTest.java     | 16 +++---
 .../dsl/AwsSesComponentBuilderFactory.java         | 62 +++++++++++-----------
 6 files changed, 52 insertions(+), 95 deletions(-)

diff --git a/components/camel-aws-ses/src/generated/java/org/apache/camel/component/aws/ses/SesComponentConfigurer.java b/components/camel-aws-ses/src/generated/java/org/apache/camel/component/aws/ses/SesComponentConfigurer.java
index b35de23..0ad6f53 100644
--- a/components/camel-aws-ses/src/generated/java/org/apache/camel/component/aws/ses/SesComponentConfigurer.java
+++ b/components/camel-aws-ses/src/generated/java/org/apache/camel/component/aws/ses/SesComponentConfigurer.java
@@ -22,10 +22,9 @@ public class SesComponentConfigurer extends PropertyConfigurerSupport implements
     public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
         SesComponent target = (SesComponent) obj;
         switch (ignoreCase ? name.toLowerCase() : name) {
-        case "accesskey":
-        case "accessKey": target.setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
         case "amazonsesclient":
         case "amazonSESClient": getOrCreateConfiguration(target).setAmazonSESClient(property(camelContext, com.amazonaws.services.simpleemail.AmazonSimpleEmailService.class, value)); return true;
+        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws.ses.SesConfiguration.class, value)); return true;
         case "lazystartproducer":
         case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
         case "proxyhost":
@@ -34,19 +33,19 @@ public class SesComponentConfigurer extends PropertyConfigurerSupport implements
         case "proxyPort": getOrCreateConfiguration(target).setProxyPort(property(camelContext, java.lang.Integer.class, value)); return true;
         case "proxyprotocol":
         case "proxyProtocol": getOrCreateConfiguration(target).setProxyProtocol(property(camelContext, com.amazonaws.Protocol.class, value)); return true;
-        case "region": target.setRegion(property(camelContext, java.lang.String.class, value)); return true;
         case "region": getOrCreateConfiguration(target).setRegion(property(camelContext, java.lang.String.class, value)); return true;
         case "replytoaddresses":
         case "replyToAddresses": getOrCreateConfiguration(target).setReplyToAddresses(property(camelContext, java.util.List.class, value)); return true;
         case "returnpath":
         case "returnPath": getOrCreateConfiguration(target).setReturnPath(property(camelContext, java.lang.String.class, value)); return true;
-        case "secretkey":
-        case "secretKey": target.setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
         case "subject": getOrCreateConfiguration(target).setSubject(property(camelContext, java.lang.String.class, value)); return true;
         case "to": getOrCreateConfiguration(target).setTo(property(camelContext, java.util.List.class, value)); return true;
         case "basicpropertybinding":
         case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
-        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws.ses.SesConfiguration.class, value)); return true;
+        case "accesskey":
+        case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
+        case "secretkey":
+        case "secretKey": getOrCreateConfiguration(target).setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
         default: return false;
         }
     }
diff --git a/components/camel-aws-ses/src/generated/resources/org/apache/camel/component/aws/ses/aws-ses.json b/components/camel-aws-ses/src/generated/resources/org/apache/camel/component/aws/ses/aws-ses.json
index bbf7596..28c720b 100644
--- a/components/camel-aws-ses/src/generated/resources/org/apache/camel/component/aws/ses/aws-ses.json
+++ b/components/camel-aws-ses/src/generated/resources/org/apache/camel/component/aws/ses/aws-ses.json
@@ -19,8 +19,8 @@
     "version": "3.2.0-SNAPSHOT"
   },
   "componentProperties": {
-    "accessKey": { "kind": "property", "displayName": "Access Key", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Amazon AWS Access Key" },
     "amazonSESClient": { "kind": "property", "displayName": "Amazon SESClient", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "com.amazonaws.services.simpleemail.AmazonSimpleEmailService", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.ses.SesConfiguration", "configurationField": "configuration", "description": "To use the AmazonSimpleEmailService as the client" },
+    "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws.ses.SesConfiguration", "deprecated": false, "secret": false, "description": "The component configuration" },
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 starting and cause the r [...]
     "proxyHost": { "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.ses.SesConfiguration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the SES client" },
     "proxyPort": { "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.ses.SesConfiguration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the SES client" },
@@ -28,11 +28,11 @@
     "region": { "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.ses.SesConfiguration", "configurationField": "configuration", "description": "The region in which SES client needs to work. When using this parameter, the configuration will expect the capitalized name of the region (for example AP_EAST [...]
     "replyToAddresses": { "kind": "property", "displayName": "Reply To Addresses", "group": "producer", "label": "", "required": false, "type": "array", "javaType": "java.util.List<java.lang.String>", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.ses.SesConfiguration", "configurationField": "configuration", "description": "List of reply-to email address(es) for the message, override it using 'CamelAwsSesReplyToAddresses' header." },
     "returnPath": { "kind": "property", "displayName": "Return Path", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.ses.SesConfiguration", "configurationField": "configuration", "description": "The email address to which bounce notifications are to be forwarded, override it using 'CamelAwsSesReturnPath' header." },
-    "secretKey": { "kind": "property", "displayName": "Secret Key", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Amazon AWS Secret Key" },
     "subject": { "kind": "property", "displayName": "Subject", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.ses.SesConfiguration", "configurationField": "configuration", "description": "The subject which is used if the message header 'CamelAwsSesSubject' is not present." },
     "to": { "kind": "property", "displayName": "To", "group": "producer", "label": "", "required": false, "type": "array", "javaType": "java.util.List<java.lang.String>", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.ses.SesConfiguration", "configurationField": "configuration", "description": "List of destination email address. Can be overriden with 'CamelAwsSesTo' header." },
     "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
-    "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws.ses.SesConfiguration", "deprecated": false, "secret": false, "description": "The AWS SES default configuration" }
+    "accessKey": { "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.ses.SesConfiguration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
+    "secretKey": { "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.ses.SesConfiguration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
   },
   "properties": {
     "from": { "kind": "path", "displayName": "From", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.aws.ses.SesConfiguration", "configurationField": "configuration", "description": "The sender's email address." },
diff --git a/components/camel-aws-ses/src/main/docs/aws-ses-component.adoc b/components/camel-aws-ses/src/main/docs/aws-ses-component.adoc
index 63aefa8..49fcf9c 100644
--- a/components/camel-aws-ses/src/main/docs/aws-ses-component.adoc
+++ b/components/camel-aws-ses/src/main/docs/aws-ses-component.adoc
@@ -37,8 +37,8 @@ The AWS Simple Email Service component supports 14 options, which are listed bel
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *accessKey* (producer) | Amazon AWS Access Key |  | String
 | *amazonSESClient* (producer) | To use the AmazonSimpleEmailService as the client |  | AmazonSimpleEmailService
+| *configuration* (producer) | The component configuration |  | SesConfiguration
 | *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 [...]
 | *proxyHost* (producer) | To define a proxy host when instantiating the SES client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the SES client |  | Integer
@@ -46,11 +46,11 @@ The AWS Simple Email Service component supports 14 options, which are listed bel
 | *region* (producer) | The region in which SES client needs to work. When using this parameter, the configuration will expect the capitalized name of the region (for example AP_EAST_1) You'll need to use the name Regions.EU_WEST_1.name() |  | String
 | *replyToAddresses* (producer) | List of reply-to email address(es) for the message, override it using 'CamelAwsSesReplyToAddresses' header. |  | List
 | *returnPath* (producer) | The email address to which bounce notifications are to be forwarded, override it using 'CamelAwsSesReturnPath' header. |  | String
-| *secretKey* (producer) | Amazon AWS Secret Key |  | String
 | *subject* (producer) | The subject which is used if the message header 'CamelAwsSesSubject' is not present. |  | String
 | *to* (producer) | List of destination email address. Can be overriden with 'CamelAwsSesTo' header. |  | List
 | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
-| *configuration* (advanced) | The AWS SES default configuration |  | SesConfiguration
+| *accessKey* (security) | Amazon AWS Access Key |  | String
+| *secretKey* (security) | Amazon AWS Secret Key |  | String
 |===
 // component options: END
 
diff --git a/components/camel-aws-ses/src/main/java/org/apache/camel/component/aws/ses/SesComponent.java b/components/camel-aws-ses/src/main/java/org/apache/camel/component/aws/ses/SesComponent.java
index a552fd4..714fbf4 100644
--- a/components/camel-aws-ses/src/main/java/org/apache/camel/component/aws/ses/SesComponent.java
+++ b/components/camel-aws-ses/src/main/java/org/apache/camel/component/aws/ses/SesComponent.java
@@ -30,13 +30,7 @@ import org.apache.camel.support.DefaultComponent;
 public class SesComponent extends DefaultComponent {
 
     @Metadata
-    private String accessKey;
-    @Metadata
-    private String secretKey;
-    @Metadata
-    private String region;
-    @Metadata(label = "advanced")
-    private SesConfiguration configuration;
+    private SesConfiguration configuration = new SesConfiguration();
 
     public SesComponent() {
         this(null);
@@ -57,9 +51,6 @@ public class SesComponent extends DefaultComponent {
         SesConfiguration configuration = this.configuration != null ? this.configuration.copy() : new SesConfiguration();
         configuration.setFrom(remaining);
         SesEndpoint endpoint = new SesEndpoint(uri, this, configuration);
-        endpoint.getConfiguration().setAccessKey(accessKey);
-        endpoint.getConfiguration().setSecretKey(secretKey);
-        endpoint.getConfiguration().setRegion(region);
         setProperties(endpoint, parameters);
         checkAndSetRegistryClient(configuration);
         if (configuration.getAmazonSESClient() == null && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
@@ -74,44 +65,11 @@ public class SesComponent extends DefaultComponent {
     }
 
     /**
-     * The AWS SES default configuration
+     * The component configuration
      */
     public void setConfiguration(SesConfiguration configuration) {
         this.configuration = configuration;
     }
-
-    public String getAccessKey() {
-        return accessKey;
-    }
-
-    /**
-     * Amazon AWS Access Key
-     */
-    public void setAccessKey(String accessKey) {
-        this.accessKey = accessKey;
-    }
-
-    public String getSecretKey() {
-        return secretKey;
-    }
-
-    /**
-     * Amazon AWS Secret Key
-     */
-    public void setSecretKey(String secretKey) {
-        this.secretKey = secretKey;
-    }
-
-    /**
-     * The region in which SES client needs to work
-     */
-    public String getRegion() {
-        return region;
-    }
-
-    public void setRegion(String region) {
-        this.region = region;
-    }
     
     private void checkAndSetRegistryClient(SesConfiguration configuration) {
         Set<AmazonSimpleEmailService> clients = getCamelContext().getRegistry().findByType(AmazonSimpleEmailService.class);
diff --git a/components/camel-aws-ses/src/test/java/org/apache/camel/component/aws/ses/SesComponentConfigurationTest.java b/components/camel-aws-ses/src/test/java/org/apache/camel/component/aws/ses/SesComponentConfigurationTest.java
index 9e1b6d4..b630144 100644
--- a/components/camel-aws-ses/src/test/java/org/apache/camel/component/aws/ses/SesComponentConfigurationTest.java
+++ b/components/camel-aws-ses/src/test/java/org/apache/camel/component/aws/ses/SesComponentConfigurationTest.java
@@ -139,8 +139,8 @@ public class SesComponentConfigurationTest extends CamelTestSupport {
     @Test
     public void createEndpointWithComponentElements() throws Exception {
         SesComponent component = context.getComponent("aws-ses", SesComponent.class);
-        component.setAccessKey("XXX");
-        component.setSecretKey("YYY");
+        component.getConfiguration().setAccessKey("XXX");
+        component.getConfiguration().setSecretKey("YYY");
         SesEndpoint endpoint = (SesEndpoint)component.createEndpoint("aws-ses://from@example.com");
         
         assertEquals("from@example.com", endpoint.getConfiguration().getFrom());
@@ -151,9 +151,9 @@ public class SesComponentConfigurationTest extends CamelTestSupport {
     @Test
     public void createEndpointWithComponentAndEndpointElements() throws Exception {
         SesComponent component = context.getComponent("aws-ses", SesComponent.class);
-        component.setAccessKey("XXX");
-        component.setSecretKey("YYY");
-        component.setRegion(Regions.US_WEST_1.toString());
+        component.getConfiguration().setAccessKey("XXX");
+        component.getConfiguration().setSecretKey("YYY");
+        component.getConfiguration().setRegion(Regions.US_WEST_1.toString());
         SesEndpoint endpoint = (SesEndpoint)component.createEndpoint("aws-ses://from@example.com?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1");
         
         assertEquals("from@example.com", endpoint.getConfiguration().getFrom());
@@ -165,9 +165,9 @@ public class SesComponentConfigurationTest extends CamelTestSupport {
     @Test
     public void createEndpointWithComponentEndpointElementsAndProxy() throws Exception {
         SesComponent component = context.getComponent("aws-ses", SesComponent.class);
-        component.setAccessKey("XXX");
-        component.setSecretKey("YYY");
-        component.setRegion(Regions.US_WEST_1.toString());
+        component.getConfiguration().setAccessKey("XXX");
+        component.getConfiguration().setSecretKey("YYY");
+        component.getConfiguration().setRegion(Regions.US_WEST_1.toString());
         SesEndpoint endpoint = (SesEndpoint)component.createEndpoint("aws-ses://label?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1&proxyHost=localhost&proxyPort=9000&proxyProtocol=HTTP");
         
         assertEquals("xxxxxx", endpoint.getConfiguration().getAccessKey());
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSesComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSesComponentBuilderFactory.java
index 194f9e3..6493bf6 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSesComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSesComponentBuilderFactory.java
@@ -48,27 +48,30 @@ public interface AwsSesComponentBuilderFactory {
      */
     interface AwsSesComponentBuilder extends ComponentBuilder<SesComponent> {
         /**
-         * Amazon AWS Access Key.
+         * To use the AmazonSimpleEmailService as the client.
          * 
-         * The option is a: <code>java.lang.String</code> type.
+         * The option is a:
+         * <code>com.amazonaws.services.simpleemail.AmazonSimpleEmailService</code> type.
          * 
          * Group: producer
          */
-        default AwsSesComponentBuilder accessKey(java.lang.String accessKey) {
-            doSetProperty("accessKey", accessKey);
+        default AwsSesComponentBuilder amazonSESClient(
+                com.amazonaws.services.simpleemail.AmazonSimpleEmailService amazonSESClient) {
+            doSetProperty("amazonSESClient", amazonSESClient);
             return this;
         }
         /**
-         * To use the AmazonSimpleEmailService as the client.
+         * The component configuration.
          * 
          * The option is a:
-         * <code>com.amazonaws.services.simpleemail.AmazonSimpleEmailService</code> type.
+         * <code>org.apache.camel.component.aws.ses.SesConfiguration</code>
+         * type.
          * 
          * Group: producer
          */
-        default AwsSesComponentBuilder amazonSESClient(
-                com.amazonaws.services.simpleemail.AmazonSimpleEmailService amazonSESClient) {
-            doSetProperty("amazonSESClient", amazonSESClient);
+        default AwsSesComponentBuilder configuration(
+                org.apache.camel.component.aws.ses.SesConfiguration configuration) {
+            doSetProperty("configuration", configuration);
             return this;
         }
         /**
@@ -167,17 +170,6 @@ public interface AwsSesComponentBuilderFactory {
             return this;
         }
         /**
-         * Amazon AWS Secret Key.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Group: producer
-         */
-        default AwsSesComponentBuilder secretKey(java.lang.String secretKey) {
-            doSetProperty("secretKey", secretKey);
-            return this;
-        }
-        /**
          * The subject which is used if the message header 'CamelAwsSesSubject'
          * is not present.
          * 
@@ -216,17 +208,25 @@ public interface AwsSesComponentBuilderFactory {
             return this;
         }
         /**
-         * The AWS SES default configuration.
+         * Amazon AWS Access Key.
          * 
-         * The option is a:
-         * <code>org.apache.camel.component.aws.ses.SesConfiguration</code>
-         * type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
-         * Group: advanced
+         * Group: security
          */
-        default AwsSesComponentBuilder configuration(
-                org.apache.camel.component.aws.ses.SesConfiguration configuration) {
-            doSetProperty("configuration", configuration);
+        default AwsSesComponentBuilder accessKey(java.lang.String accessKey) {
+            doSetProperty("accessKey", accessKey);
+            return this;
+        }
+        /**
+         * Amazon AWS Secret Key.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: security
+         */
+        default AwsSesComponentBuilder secretKey(java.lang.String secretKey) {
+            doSetProperty("secretKey", secretKey);
             return this;
         }
     }
@@ -253,8 +253,8 @@ public interface AwsSesComponentBuilderFactory {
                 String name,
                 Object value) {
             switch (name) {
-            case "accessKey": ((SesComponent) component).setAccessKey((java.lang.String) value); return true;
             case "amazonSESClient": getOrCreateConfiguration((SesComponent) component).setAmazonSESClient((com.amazonaws.services.simpleemail.AmazonSimpleEmailService) value); return true;
+            case "configuration": ((SesComponent) component).setConfiguration((org.apache.camel.component.aws.ses.SesConfiguration) value); return true;
             case "lazyStartProducer": ((SesComponent) component).setLazyStartProducer((boolean) value); return true;
             case "proxyHost": getOrCreateConfiguration((SesComponent) component).setProxyHost((java.lang.String) value); return true;
             case "proxyPort": getOrCreateConfiguration((SesComponent) component).setProxyPort((java.lang.Integer) value); return true;
@@ -262,11 +262,11 @@ public interface AwsSesComponentBuilderFactory {
             case "region": getOrCreateConfiguration((SesComponent) component).setRegion((java.lang.String) value); return true;
             case "replyToAddresses": getOrCreateConfiguration((SesComponent) component).setReplyToAddresses((java.util.List) value); return true;
             case "returnPath": getOrCreateConfiguration((SesComponent) component).setReturnPath((java.lang.String) value); return true;
-            case "secretKey": ((SesComponent) component).setSecretKey((java.lang.String) value); return true;
             case "subject": getOrCreateConfiguration((SesComponent) component).setSubject((java.lang.String) value); return true;
             case "to": getOrCreateConfiguration((SesComponent) component).setTo((java.util.List) value); return true;
             case "basicPropertyBinding": ((SesComponent) component).setBasicPropertyBinding((boolean) value); return true;
-            case "configuration": ((SesComponent) component).setConfiguration((org.apache.camel.component.aws.ses.SesConfiguration) value); return true;
+            case "accessKey": getOrCreateConfiguration((SesComponent) component).setAccessKey((java.lang.String) value); return true;
+            case "secretKey": getOrCreateConfiguration((SesComponent) component).setSecretKey((java.lang.String) value); return true;
             default: return false;
             }
         }


[camel] 02/04: CAMEL-14568 - Fixed AWS SNS

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 86b133390023d56fd358ef964ada7f091792c726
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Feb 28 16:48:54 2020 +0100

    CAMEL-14568 - Fixed AWS SNS
---
 .../component/aws/sns/SnsComponentConfigurer.java  | 11 ++--
 .../apache/camel/component/aws/sns/aws-sns.json    |  6 +-
 .../src/main/docs/aws-sns-component.adoc           |  6 +-
 .../camel/component/aws/sns/SnsComponent.java      | 49 +---------------
 .../aws/sns/SnsComponentConfigurationTest.java     | 22 ++++----
 .../dsl/AwsSnsComponentBuilderFactory.java         | 66 +++++++++++-----------
 6 files changed, 58 insertions(+), 102 deletions(-)

diff --git a/components/camel-aws-sns/src/generated/java/org/apache/camel/component/aws/sns/SnsComponentConfigurer.java b/components/camel-aws-sns/src/generated/java/org/apache/camel/component/aws/sns/SnsComponentConfigurer.java
index 6b57de8..c16362f 100644
--- a/components/camel-aws-sns/src/generated/java/org/apache/camel/component/aws/sns/SnsComponentConfigurer.java
+++ b/components/camel-aws-sns/src/generated/java/org/apache/camel/component/aws/sns/SnsComponentConfigurer.java
@@ -22,14 +22,13 @@ public class SnsComponentConfigurer extends PropertyConfigurerSupport implements
     public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
         SnsComponent target = (SnsComponent) obj;
         switch (ignoreCase ? name.toLowerCase() : name) {
-        case "accesskey":
-        case "accessKey": target.setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
         case "amazonsnsclient":
         case "amazonSNSClient": getOrCreateConfiguration(target).setAmazonSNSClient(property(camelContext, com.amazonaws.services.sns.AmazonSNS.class, value)); return true;
         case "amazonsqsclient":
         case "amazonSQSClient": getOrCreateConfiguration(target).setAmazonSQSClient(property(camelContext, com.amazonaws.services.sqs.AmazonSQS.class, value)); return true;
         case "autocreatetopic":
         case "autoCreateTopic": getOrCreateConfiguration(target).setAutoCreateTopic(property(camelContext, boolean.class, value)); return true;
+        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws.sns.SnsConfiguration.class, value)); return true;
         case "kmsmasterkeyid":
         case "kmsMasterKeyId": getOrCreateConfiguration(target).setKmsMasterKeyId(property(camelContext, java.lang.String.class, value)); return true;
         case "lazystartproducer":
@@ -45,10 +44,7 @@ public class SnsComponentConfigurer extends PropertyConfigurerSupport implements
         case "proxyProtocol": getOrCreateConfiguration(target).setProxyProtocol(property(camelContext, com.amazonaws.Protocol.class, value)); return true;
         case "queueurl":
         case "queueUrl": getOrCreateConfiguration(target).setQueueUrl(property(camelContext, java.lang.String.class, value)); return true;
-        case "region": target.setRegion(property(camelContext, java.lang.String.class, value)); return true;
         case "region": getOrCreateConfiguration(target).setRegion(property(camelContext, java.lang.String.class, value)); return true;
-        case "secretkey":
-        case "secretKey": target.setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
         case "serversideencryptionenabled":
         case "serverSideEncryptionEnabled": getOrCreateConfiguration(target).setServerSideEncryptionEnabled(property(camelContext, boolean.class, value)); return true;
         case "subject": getOrCreateConfiguration(target).setSubject(property(camelContext, java.lang.String.class, value)); return true;
@@ -56,7 +52,10 @@ public class SnsComponentConfigurer extends PropertyConfigurerSupport implements
         case "subscribeSNStoSQS": getOrCreateConfiguration(target).setSubscribeSNStoSQS(property(camelContext, boolean.class, value)); return true;
         case "basicpropertybinding":
         case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
-        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws.sns.SnsConfiguration.class, value)); return true;
+        case "accesskey":
+        case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
+        case "secretkey":
+        case "secretKey": getOrCreateConfiguration(target).setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
         default: return false;
         }
     }
diff --git a/components/camel-aws-sns/src/generated/resources/org/apache/camel/component/aws/sns/aws-sns.json b/components/camel-aws-sns/src/generated/resources/org/apache/camel/component/aws/sns/aws-sns.json
index e1089c2..bfb4869 100644
--- a/components/camel-aws-sns/src/generated/resources/org/apache/camel/component/aws/sns/aws-sns.json
+++ b/components/camel-aws-sns/src/generated/resources/org/apache/camel/component/aws/sns/aws-sns.json
@@ -19,10 +19,10 @@
     "version": "3.2.0-SNAPSHOT"
   },
   "componentProperties": {
-    "accessKey": { "kind": "property", "displayName": "Access Key", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Amazon AWS Access Key" },
     "amazonSNSClient": { "kind": "property", "displayName": "Amazon SNSClient", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "com.amazonaws.services.sns.AmazonSNS", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sns.SnsConfiguration", "configurationField": "configuration", "description": "To use the AmazonSNS as the client" },
     "amazonSQSClient": { "kind": "property", "displayName": "Amazon SQSClient", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "com.amazonaws.services.sqs.AmazonSQS", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sns.SnsConfiguration", "configurationField": "configuration", "description": "An SQS Client to use as bridge between SNS and SQS" },
     "autoCreateTopic": { "kind": "property", "displayName": "Auto Create Topic", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.aws.sns.SnsConfiguration", "configurationField": "configuration", "description": "Setting the autocreation of the topic" },
+    "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws.sns.SnsConfiguration", "deprecated": false, "secret": false, "description": "The component configuration" },
     "kmsMasterKeyId": { "kind": "property", "displayName": "Kms Master Key Id", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sns.SnsConfiguration", "configurationField": "configuration", "description": "The ID of an AWS-managed customer master key (CMK) for Amazon SNS or a custom CMK." },
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 starting and cause the r [...]
     "messageStructure": { "kind": "property", "displayName": "Message Structure", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sns.SnsConfiguration", "configurationField": "configuration", "description": "The message structure to use such as json" },
@@ -32,12 +32,12 @@
     "proxyProtocol": { "kind": "property", "displayName": "Proxy Protocol", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "com.amazonaws.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws.sns.SnsConfiguration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating the SNS client" },
     "queueUrl": { "kind": "property", "displayName": "Queue Url", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sns.SnsConfiguration", "configurationField": "configuration", "description": "The queueUrl to subscribe to" },
     "region": { "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sns.SnsConfiguration", "configurationField": "configuration", "description": "The region in which SNS client needs to work. When using this parameter, the configuration will expect the capitalized name of the region (for example AP_EAST [...]
-    "secretKey": { "kind": "property", "displayName": "Secret Key", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Amazon AWS Secret Key" },
     "serverSideEncryptionEnabled": { "kind": "property", "displayName": "Server Side Encryption Enabled", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws.sns.SnsConfiguration", "configurationField": "configuration", "description": "Define if Server Side Encryption is enabled or not on the topic" },
     "subject": { "kind": "property", "displayName": "Subject", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sns.SnsConfiguration", "configurationField": "configuration", "description": "The subject which is used if the message header 'CamelAwsSnsSubject' is not present." },
     "subscribeSNStoSQS": { "kind": "property", "displayName": "Subscribe SNSto SQS", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws.sns.SnsConfiguration", "configurationField": "configuration", "description": "Define if the subscription between SNS Topic and SQS must be done or not" },
     "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
-    "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws.sns.SnsConfiguration", "deprecated": false, "secret": false, "description": "The AWS SNS default configuration" }
+    "accessKey": { "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.sns.SnsConfiguration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
+    "secretKey": { "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.sns.SnsConfiguration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
   },
   "properties": {
     "topicNameOrArn": { "kind": "path", "displayName": "Topic Name Or Arn", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "description": "Topic name or ARN" },
diff --git a/components/camel-aws-sns/src/main/docs/aws-sns-component.adoc b/components/camel-aws-sns/src/main/docs/aws-sns-component.adoc
index 3192664..82097dd 100644
--- a/components/camel-aws-sns/src/main/docs/aws-sns-component.adoc
+++ b/components/camel-aws-sns/src/main/docs/aws-sns-component.adoc
@@ -40,10 +40,10 @@ The AWS Simple Notification System component supports 19 options, which are list
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *accessKey* (producer) | Amazon AWS Access Key |  | String
 | *amazonSNSClient* (producer) | To use the AmazonSNS as the client |  | AmazonSNS
 | *amazonSQSClient* (producer) | An SQS Client to use as bridge between SNS and SQS |  | AmazonSQS
 | *autoCreateTopic* (producer) | Setting the autocreation of the topic | true | boolean
+| *configuration* (producer) | The component configuration |  | SnsConfiguration
 | *kmsMasterKeyId* (producer) | The ID of an AWS-managed customer master key (CMK) for Amazon SNS or a custom CMK. |  | String
 | *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 [...]
 | *messageStructure* (producer) | The message structure to use such as json |  | String
@@ -53,12 +53,12 @@ The AWS Simple Notification System component supports 19 options, which are list
 | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the SNS client. The value can be one of: HTTP, HTTPS | HTTPS | Protocol
 | *queueUrl* (producer) | The queueUrl to subscribe to |  | String
 | *region* (producer) | The region in which SNS client needs to work. When using this parameter, the configuration will expect the capitalized name of the region (for example AP_EAST_1) You'll need to use the name Regions.EU_WEST_1.name() |  | String
-| *secretKey* (producer) | Amazon AWS Secret Key |  | String
 | *serverSideEncryptionEnabled* (producer) | Define if Server Side Encryption is enabled or not on the topic | false | boolean
 | *subject* (producer) | The subject which is used if the message header 'CamelAwsSnsSubject' is not present. |  | String
 | *subscribeSNStoSQS* (producer) | Define if the subscription between SNS Topic and SQS must be done or not | false | boolean
 | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
-| *configuration* (advanced) | The AWS SNS default configuration |  | SnsConfiguration
+| *accessKey* (security) | Amazon AWS Access Key |  | String
+| *secretKey* (security) | Amazon AWS Secret Key |  | String
 |===
 // component options: END
 
diff --git a/components/camel-aws-sns/src/main/java/org/apache/camel/component/aws/sns/SnsComponent.java b/components/camel-aws-sns/src/main/java/org/apache/camel/component/aws/sns/SnsComponent.java
index 7337cdd..2a34db1 100644
--- a/components/camel-aws-sns/src/main/java/org/apache/camel/component/aws/sns/SnsComponent.java
+++ b/components/camel-aws-sns/src/main/java/org/apache/camel/component/aws/sns/SnsComponent.java
@@ -26,19 +26,12 @@ import org.apache.camel.Endpoint;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.support.DefaultComponent;
-import org.apache.camel.util.ObjectHelper;
 
 @Component("aws-sns")
 public class SnsComponent extends DefaultComponent {
     
-    @Metadata
-    private String accessKey;
-    @Metadata
-    private String secretKey;
-    @Metadata
-    private String region;
-    @Metadata(label = "advanced")    
-    private SnsConfiguration configuration;
+    @Metadata  
+    private SnsConfiguration configuration = new SnsConfiguration();
     
     public SnsComponent() {
         this(null);
@@ -68,9 +61,6 @@ public class SnsComponent extends DefaultComponent {
             configuration.setTopicName(remaining);
         }
         SnsEndpoint endpoint = new SnsEndpoint(uri, this, configuration);
-        endpoint.getConfiguration().setAccessKey(accessKey);
-        endpoint.getConfiguration().setSecretKey(secretKey);
-        endpoint.getConfiguration().setRegion(region);
         setProperties(endpoint, parameters);
         checkAndSetRegistryClient(configuration);
         if (configuration.getAmazonSNSClient() == null && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
@@ -85,44 +75,11 @@ public class SnsComponent extends DefaultComponent {
     }
 
     /**
-     * The AWS SNS default configuration
+     * The component configuration
      */
     public void setConfiguration(SnsConfiguration configuration) {
         this.configuration = configuration;
     }
-
-    public String getAccessKey() {
-        return accessKey;
-    }
-
-    /**
-     * Amazon AWS Access Key
-     */
-    public void setAccessKey(String accessKey) {
-        this.accessKey = accessKey;
-    }
-
-    public String getSecretKey() {
-        return secretKey;
-    }
-
-    /**
-     * Amazon AWS Secret Key
-     */
-    public void setSecretKey(String secretKey) {
-        this.secretKey = secretKey;
-    }
-    
-    /**
-     * The region in which SNS client needs to work
-     */
-    public String getRegion() {
-        return region;
-    }
-
-    public void setRegion(String region) {
-        this.region = region;
-    }
     
     private void checkAndSetRegistryClient(SnsConfiguration configuration) {
         Set<AmazonSNS> clients = getCamelContext().getRegistry().findByType(AmazonSNS.class);
diff --git a/components/camel-aws-sns/src/test/java/org/apache/camel/component/aws/sns/SnsComponentConfigurationTest.java b/components/camel-aws-sns/src/test/java/org/apache/camel/component/aws/sns/SnsComponentConfigurationTest.java
index 1e723e1..f14367f 100644
--- a/components/camel-aws-sns/src/test/java/org/apache/camel/component/aws/sns/SnsComponentConfigurationTest.java
+++ b/components/camel-aws-sns/src/test/java/org/apache/camel/component/aws/sns/SnsComponentConfigurationTest.java
@@ -175,8 +175,8 @@ public class SnsComponentConfigurationTest extends CamelTestSupport {
     @Test
     public void createEndpointWithComponentElements() throws Exception {
         SnsComponent component = context.getComponent("aws-sns", SnsComponent.class);
-        component.setAccessKey("XXX");
-        component.setSecretKey("YYY");
+        component.getConfiguration().setAccessKey("XXX");
+        component.getConfiguration().setSecretKey("YYY");
         SnsEndpoint endpoint = (SnsEndpoint)component.createEndpoint("aws-sns://MyTopic");
         
         assertEquals("MyTopic", endpoint.getConfiguration().getTopicName());
@@ -187,9 +187,9 @@ public class SnsComponentConfigurationTest extends CamelTestSupport {
     @Test
     public void createEndpointWithComponentAndEndpointElements() throws Exception {
         SnsComponent component = context.getComponent("aws-sns", SnsComponent.class);
-        component.setAccessKey("XXX");
-        component.setSecretKey("YYY");
-        component.setRegion(Regions.US_WEST_1.toString());
+        component.getConfiguration().setAccessKey("XXX");
+        component.getConfiguration().setSecretKey("YYY");
+        component.getConfiguration().setRegion(Regions.US_WEST_1.toString());
         SnsEndpoint endpoint = (SnsEndpoint)component.createEndpoint("aws-sns://MyTopic?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1");
         
         assertEquals("MyTopic", endpoint.getConfiguration().getTopicName());
@@ -201,9 +201,9 @@ public class SnsComponentConfigurationTest extends CamelTestSupport {
     @Test
     public void createEndpointWithoutAutocreation() throws Exception {
         SnsComponent component = context.getComponent("aws-sns", SnsComponent.class);
-        component.setAccessKey("XXX");
-        component.setSecretKey("YYY");
-        component.setRegion(Regions.US_WEST_1.toString());
+        component.getConfiguration().setAccessKey("XXX");
+        component.getConfiguration().setSecretKey("YYY");
+        component.getConfiguration().setRegion(Regions.US_WEST_1.toString());
         SnsEndpoint endpoint = (SnsEndpoint)component.createEndpoint("aws-sns://MyTopic?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1&autoCreateTopic=false");
         
         assertEquals("MyTopic", endpoint.getConfiguration().getTopicName());
@@ -216,9 +216,9 @@ public class SnsComponentConfigurationTest extends CamelTestSupport {
     @Test
     public void createEndpointWithComponentEndpointElementsAndProxy() throws Exception {
         SnsComponent component = context.getComponent("aws-sns", SnsComponent.class);
-        component.setAccessKey("XXX");
-        component.setSecretKey("YYY");
-        component.setRegion(Regions.US_WEST_1.toString());
+        component.getConfiguration().setAccessKey("XXX");
+        component.getConfiguration().setSecretKey("YYY");
+        component.getConfiguration().setRegion(Regions.US_WEST_1.toString());
         SnsEndpoint endpoint = (SnsEndpoint)component.createEndpoint("aws-sns://label?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1&proxyHost=localhost&proxyPort=9000&proxyProtocol=HTTP");
         
         assertEquals("xxxxxx", endpoint.getConfiguration().getAccessKey());
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSnsComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSnsComponentBuilderFactory.java
index 2a64f66..a6c1c2d 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSnsComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSnsComponentBuilderFactory.java
@@ -49,17 +49,6 @@ public interface AwsSnsComponentBuilderFactory {
      */
     interface AwsSnsComponentBuilder extends ComponentBuilder<SnsComponent> {
         /**
-         * Amazon AWS Access Key.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Group: producer
-         */
-        default AwsSnsComponentBuilder accessKey(java.lang.String accessKey) {
-            doSetProperty("accessKey", accessKey);
-            return this;
-        }
-        /**
          * To use the AmazonSNS as the client.
          * 
          * The option is a: <code>com.amazonaws.services.sns.AmazonSNS</code>
@@ -98,6 +87,20 @@ public interface AwsSnsComponentBuilderFactory {
             return this;
         }
         /**
+         * The component configuration.
+         * 
+         * The option is a:
+         * <code>org.apache.camel.component.aws.sns.SnsConfiguration</code>
+         * type.
+         * 
+         * Group: producer
+         */
+        default AwsSnsComponentBuilder configuration(
+                org.apache.camel.component.aws.sns.SnsConfiguration configuration) {
+            doSetProperty("configuration", configuration);
+            return this;
+        }
+        /**
          * The ID of an AWS-managed customer master key (CMK) for Amazon SNS or
          * a custom CMK.
          * 
@@ -215,17 +218,6 @@ public interface AwsSnsComponentBuilderFactory {
             return this;
         }
         /**
-         * Amazon AWS Secret Key.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Group: producer
-         */
-        default AwsSnsComponentBuilder secretKey(java.lang.String secretKey) {
-            doSetProperty("secretKey", secretKey);
-            return this;
-        }
-        /**
          * Define if Server Side Encryption is enabled or not on the topic.
          * 
          * The option is a: <code>boolean</code> type.
@@ -279,17 +271,25 @@ public interface AwsSnsComponentBuilderFactory {
             return this;
         }
         /**
-         * The AWS SNS default configuration.
+         * Amazon AWS Access Key.
          * 
-         * The option is a:
-         * <code>org.apache.camel.component.aws.sns.SnsConfiguration</code>
-         * type.
+         * The option is a: <code>java.lang.String</code> type.
          * 
-         * Group: advanced
+         * Group: security
          */
-        default AwsSnsComponentBuilder configuration(
-                org.apache.camel.component.aws.sns.SnsConfiguration configuration) {
-            doSetProperty("configuration", configuration);
+        default AwsSnsComponentBuilder accessKey(java.lang.String accessKey) {
+            doSetProperty("accessKey", accessKey);
+            return this;
+        }
+        /**
+         * Amazon AWS Secret Key.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: security
+         */
+        default AwsSnsComponentBuilder secretKey(java.lang.String secretKey) {
+            doSetProperty("secretKey", secretKey);
             return this;
         }
     }
@@ -316,10 +316,10 @@ public interface AwsSnsComponentBuilderFactory {
                 String name,
                 Object value) {
             switch (name) {
-            case "accessKey": ((SnsComponent) component).setAccessKey((java.lang.String) value); return true;
             case "amazonSNSClient": getOrCreateConfiguration((SnsComponent) component).setAmazonSNSClient((com.amazonaws.services.sns.AmazonSNS) value); return true;
             case "amazonSQSClient": getOrCreateConfiguration((SnsComponent) component).setAmazonSQSClient((com.amazonaws.services.sqs.AmazonSQS) value); return true;
             case "autoCreateTopic": getOrCreateConfiguration((SnsComponent) component).setAutoCreateTopic((boolean) value); return true;
+            case "configuration": ((SnsComponent) component).setConfiguration((org.apache.camel.component.aws.sns.SnsConfiguration) value); return true;
             case "kmsMasterKeyId": getOrCreateConfiguration((SnsComponent) component).setKmsMasterKeyId((java.lang.String) value); return true;
             case "lazyStartProducer": ((SnsComponent) component).setLazyStartProducer((boolean) value); return true;
             case "messageStructure": getOrCreateConfiguration((SnsComponent) component).setMessageStructure((java.lang.String) value); return true;
@@ -329,12 +329,12 @@ public interface AwsSnsComponentBuilderFactory {
             case "proxyProtocol": getOrCreateConfiguration((SnsComponent) component).setProxyProtocol((com.amazonaws.Protocol) value); return true;
             case "queueUrl": getOrCreateConfiguration((SnsComponent) component).setQueueUrl((java.lang.String) value); return true;
             case "region": getOrCreateConfiguration((SnsComponent) component).setRegion((java.lang.String) value); return true;
-            case "secretKey": ((SnsComponent) component).setSecretKey((java.lang.String) value); return true;
             case "serverSideEncryptionEnabled": getOrCreateConfiguration((SnsComponent) component).setServerSideEncryptionEnabled((boolean) value); return true;
             case "subject": getOrCreateConfiguration((SnsComponent) component).setSubject((java.lang.String) value); return true;
             case "subscribeSNStoSQS": getOrCreateConfiguration((SnsComponent) component).setSubscribeSNStoSQS((boolean) value); return true;
             case "basicPropertyBinding": ((SnsComponent) component).setBasicPropertyBinding((boolean) value); return true;
-            case "configuration": ((SnsComponent) component).setConfiguration((org.apache.camel.component.aws.sns.SnsConfiguration) value); return true;
+            case "accessKey": getOrCreateConfiguration((SnsComponent) component).setAccessKey((java.lang.String) value); return true;
+            case "secretKey": getOrCreateConfiguration((SnsComponent) component).setSecretKey((java.lang.String) value); return true;
             default: return false;
             }
         }


[camel] 04/04: CAMEL-14568 - Fixed AWS SWF

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 2200e00510836794634bef881dffa6e27f98d327
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Feb 28 16:56:38 2020 +0100

    CAMEL-14568 - Fixed AWS SWF
---
 .../component/aws/swf/SWFComponentConfigurer.java  | 11 ++--
 .../apache/camel/component/aws/swf/aws-swf.json    |  8 +--
 .../src/main/docs/aws-swf-component.adoc           |  6 +-
 .../camel/component/aws/swf/SWFComponent.java      | 46 +-------------
 .../aws/swf/SWFComponentConfigurationTest.java     | 10 +--
 .../dsl/AwsSwfComponentBuilderFactory.java         | 74 +++++++++++-----------
 6 files changed, 56 insertions(+), 99 deletions(-)

diff --git a/components/camel-aws-swf/src/generated/java/org/apache/camel/component/aws/swf/SWFComponentConfigurer.java b/components/camel-aws-swf/src/generated/java/org/apache/camel/component/aws/swf/SWFComponentConfigurer.java
index 7427ac8..1b46a0e 100644
--- a/components/camel-aws-swf/src/generated/java/org/apache/camel/component/aws/swf/SWFComponentConfigurer.java
+++ b/components/camel-aws-swf/src/generated/java/org/apache/camel/component/aws/swf/SWFComponentConfigurer.java
@@ -22,20 +22,16 @@ public class SWFComponentConfigurer extends PropertyConfigurerSupport implements
     public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
         SWFComponent target = (SWFComponent) obj;
         switch (ignoreCase ? name.toLowerCase() : name) {
-        case "accesskey":
-        case "accessKey": target.setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
         case "amazonswclient":
         case "amazonSWClient": getOrCreateConfiguration(target).setAmazonSWClient(property(camelContext, com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflow.class, value)); return true;
+        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws.swf.SWFConfiguration.class, value)); return true;
         case "dataconverter":
         case "dataConverter": getOrCreateConfiguration(target).setDataConverter(property(camelContext, com.amazonaws.services.simpleworkflow.flow.DataConverter.class, value)); return true;
         case "domainname":
         case "domainName": getOrCreateConfiguration(target).setDomainName(property(camelContext, java.lang.String.class, value)); return true;
         case "eventname":
         case "eventName": getOrCreateConfiguration(target).setEventName(property(camelContext, java.lang.String.class, value)); return true;
-        case "region": target.setRegion(property(camelContext, java.lang.String.class, value)); return true;
         case "region": getOrCreateConfiguration(target).setRegion(property(camelContext, java.lang.String.class, value)); return true;
-        case "secretkey":
-        case "secretKey": target.setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
         case "version": getOrCreateConfiguration(target).setVersion(property(camelContext, java.lang.String.class, value)); return true;
         case "bridgeerrorhandler":
         case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
@@ -45,7 +41,6 @@ public class SWFComponentConfigurer extends PropertyConfigurerSupport implements
         case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
         case "clientconfigurationparameters":
         case "clientConfigurationParameters": getOrCreateConfiguration(target).setClientConfigurationParameters(property(camelContext, java.util.Map.class, value)); return true;
-        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws.swf.SWFConfiguration.class, value)); return true;
         case "startworkflowoptionsparameters":
         case "startWorkflowOptionsParameters": getOrCreateConfiguration(target).setStartWorkflowOptionsParameters(property(camelContext, java.util.Map.class, value)); return true;
         case "swclientparameters":
@@ -79,6 +74,10 @@ public class SWFComponentConfigurer extends PropertyConfigurerSupport implements
         case "workflowList": getOrCreateConfiguration(target).setWorkflowList(property(camelContext, java.lang.String.class, value)); return true;
         case "workflowtyperegistrationoptions":
         case "workflowTypeRegistrationOptions": getOrCreateConfiguration(target).setWorkflowTypeRegistrationOptions(property(camelContext, com.amazonaws.services.simpleworkflow.flow.WorkflowTypeRegistrationOptions.class, value)); return true;
+        case "accesskey":
+        case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
+        case "secretkey":
+        case "secretKey": getOrCreateConfiguration(target).setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
         default: return false;
         }
     }
diff --git a/components/camel-aws-swf/src/generated/resources/org/apache/camel/component/aws/swf/aws-swf.json b/components/camel-aws-swf/src/generated/resources/org/apache/camel/component/aws/swf/aws-swf.json
index 3d12fa9..206f3e4 100644
--- a/components/camel-aws-swf/src/generated/resources/org/apache/camel/component/aws/swf/aws-swf.json
+++ b/components/camel-aws-swf/src/generated/resources/org/apache/camel/component/aws/swf/aws-swf.json
@@ -19,19 +19,17 @@
     "version": "3.2.0-SNAPSHOT"
   },
   "componentProperties": {
-    "accessKey": { "kind": "property", "displayName": "Access Key", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Amazon AWS Access Key." },
     "amazonSWClient": { "kind": "property", "displayName": "Amazon SWClient", "group": "common", "label": "", "required": false, "type": "object", "javaType": "com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflow", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "To use the given AmazonSimpleWorkflowClient as client" },
+    "configuration": { "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws.swf.SWFConfiguration", "deprecated": false, "secret": false, "description": "The component configuration" },
     "dataConverter": { "kind": "property", "displayName": "Data Converter", "group": "common", "label": "", "required": false, "type": "object", "javaType": "com.amazonaws.services.simpleworkflow.flow.DataConverter", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "An instance of com.amazonaws.services.simpleworkflow.flow.DataConverter to use for serializing\/deseriali [...]
     "domainName": { "kind": "property", "displayName": "Domain Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "The workflow domain to use." },
     "eventName": { "kind": "property", "displayName": "Event Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "The workflow or activity event name to use." },
     "region": { "kind": "property", "displayName": "Region", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "Amazon AWS Region. When using this parameter, the configuration will expect the capitalized name of the region (for example AP_EAST_1) You'll need to use  [...]
-    "secretKey": { "kind": "property", "displayName": "Secret Key", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Amazon AWS Secret Key." },
     "version": { "kind": "property", "displayName": "Version", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "The workflow or activity event version to use." },
     "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 message and handled by [...]
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 starting and cause the r [...]
     "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
     "clientConfigurationParameters": { "kind": "property", "displayName": "Client Configuration Parameters", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "clientConfiguration.", "multiValue": true, "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "To configure th [...]
-    "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws.swf.SWFConfiguration", "deprecated": false, "secret": false, "description": "The AWS SWF default configuration" },
     "startWorkflowOptionsParameters": { "kind": "property", "displayName": "Start Workflow Options Parameters", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "startWorkflowOptions.", "multiValue": true, "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "To configur [...]
     "sWClientParameters": { "kind": "property", "displayName": "SWClient Parameters", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "sWClient.", "multiValue": true, "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "To configure the AmazonSimpleWorkflowClient using [...]
     "activityList": { "kind": "property", "displayName": "Activity List", "group": "activity", "label": "consumer,activity", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "The list name to consume activities from." },
@@ -48,7 +46,9 @@
     "terminationDetails": { "kind": "property", "displayName": "Termination Details", "group": "workflow", "label": "producer,workflow", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "Details for terminating a workflow." },
     "terminationReason": { "kind": "property", "displayName": "Termination Reason", "group": "workflow", "label": "producer,workflow", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "The reason for terminating a workflow." },
     "workflowList": { "kind": "property", "displayName": "Workflow List", "group": "workflow", "label": "consumer,workflow", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "The list name to consume workflows from." },
-    "workflowTypeRegistrationOptions": { "kind": "property", "displayName": "Workflow Type Registration Options", "group": "workflow", "label": "consumer,workflow", "required": false, "type": "object", "javaType": "com.amazonaws.services.simpleworkflow.flow.WorkflowTypeRegistrationOptions", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "Workflow registration options" }
+    "workflowTypeRegistrationOptions": { "kind": "property", "displayName": "Workflow Type Registration Options", "group": "workflow", "label": "consumer,workflow", "required": false, "type": "object", "javaType": "com.amazonaws.services.simpleworkflow.flow.WorkflowTypeRegistrationOptions", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "Workflow registration options" },
+    "accessKey": { "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "Amazon AWS Access Key." },
+    "secretKey": { "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "Amazon AWS Secret Key." }
   },
   "properties": {
     "type": { "kind": "path", "displayName": "Type", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "enum": [ "activity", "workflow" ], "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.aws.swf.SWFConfiguration", "configurationField": "configuration", "description": "Activity or workflow" },
diff --git a/components/camel-aws-swf/src/main/docs/aws-swf-component.adoc b/components/camel-aws-swf/src/main/docs/aws-swf-component.adoc
index 5c95f99..2092955 100644
--- a/components/camel-aws-swf/src/main/docs/aws-swf-component.adoc
+++ b/components/camel-aws-swf/src/main/docs/aws-swf-component.adoc
@@ -37,19 +37,17 @@ The AWS Simple Workflow component supports 30 options, which are listed below.
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *accessKey* (common) | Amazon AWS Access Key. |  | String
 | *amazonSWClient* (common) | To use the given AmazonSimpleWorkflowClient as client |  | AmazonSimpleWorkflow
+| *configuration* (common) | The component configuration |  | SWFConfiguration
 | *dataConverter* (common) | An instance of com.amazonaws.services.simpleworkflow.flow.DataConverter to use for serializing/deserializing the data. |  | DataConverter
 | *domainName* (common) | The workflow domain to use. |  | String
 | *eventName* (common) | The workflow or activity event name to use. |  | String
 | *region* (common) | Amazon AWS Region. When using this parameter, the configuration will expect the capitalized name of the region (for example AP_EAST_1) You'll need to use the name Regions.EU_WEST_1.name() |  | String
-| *secretKey* (common) | Amazon AWS Secret Key. |  | String
 | *version* (common) | The workflow or activity event version to use. |  | 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 [...]
 | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *clientConfigurationParameters* (advanced) | To configure the ClientConfiguration using the key/values from the Map. |  | Map
-| *configuration* (advanced) | The AWS SWF default configuration |  | SWFConfiguration
 | *startWorkflowOptionsParameters* (advanced) | To configure the StartWorkflowOptions using the key/values from the Map. |  | Map
 | *sWClientParameters* (advanced) | To configure the AmazonSimpleWorkflowClient using the key/values from the Map. |  | Map
 | *activityList* (activity) | The list name to consume activities from. |  | String
@@ -67,6 +65,8 @@ The AWS Simple Workflow component supports 30 options, which are listed below.
 | *terminationReason* (workflow) | The reason for terminating a workflow. |  | String
 | *workflowList* (workflow) | The list name to consume workflows from. |  | String
 | *workflowTypeRegistration Options* (workflow) | Workflow registration options |  | WorkflowTypeRegistrationOptions
+| *accessKey* (security) | Amazon AWS Access Key. |  | String
+| *secretKey* (security) | Amazon AWS Secret Key. |  | String
 |===
 // component options: END
 
diff --git a/components/camel-aws-swf/src/main/java/org/apache/camel/component/aws/swf/SWFComponent.java b/components/camel-aws-swf/src/main/java/org/apache/camel/component/aws/swf/SWFComponent.java
index a6d62c7..ddff81a 100644
--- a/components/camel-aws-swf/src/main/java/org/apache/camel/component/aws/swf/SWFComponent.java
+++ b/components/camel-aws-swf/src/main/java/org/apache/camel/component/aws/swf/SWFComponent.java
@@ -32,13 +32,7 @@ import org.apache.camel.util.PropertiesHelper;
 public class SWFComponent extends DefaultComponent {
 
     @Metadata
-    private String accessKey;
-    @Metadata
-    private String secretKey;
-    @Metadata
-    private String region;
-    @Metadata(label = "advanced")    
-    private SWFConfiguration configuration;
+    private SWFConfiguration configuration = new SWFConfiguration();
     
     public SWFComponent() {
         this(null);
@@ -63,9 +57,6 @@ public class SWFComponent extends DefaultComponent {
         configuration.setStartWorkflowOptionsParameters(startWorkflowOptionsParameters);
         
         SWFEndpoint endpoint = new SWFEndpoint(uri, this, configuration);
-        endpoint.getConfiguration().setAccessKey(accessKey);
-        endpoint.getConfiguration().setSecretKey(secretKey);
-        endpoint.getConfiguration().setRegion(region);
         setProperties(endpoint, parameters);
         checkAndSetRegistryClient(configuration);
         if (configuration.getAmazonSWClient() == null && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
@@ -79,44 +70,11 @@ public class SWFComponent extends DefaultComponent {
     }
 
     /**
-     * The AWS SWF default configuration
+     * The component configuration
      */    
     public void setConfiguration(SWFConfiguration configuration) {
         this.configuration = configuration;
     }
-
-    public String getAccessKey() {
-        return accessKey;
-    }
-
-    /**
-     * Amazon AWS Access Key.
-     */
-    public void setAccessKey(String accessKey) {
-        this.accessKey = accessKey;
-    }
-
-    public String getSecretKey() {
-        return secretKey;
-    }
-
-    /**
-     * Amazon AWS Secret Key.
-     */
-    public void setSecretKey(String secretKey) {
-        this.secretKey = secretKey;
-    }
-
-    public String getRegion() {
-        return region;
-    }
-
-    /**
-     * Amazon AWS Region.
-     */
-    public void setRegion(String region) {
-        this.region = region;
-    }
     
     private void checkAndSetRegistryClient(SWFConfiguration configuration) {
         Set<AmazonSimpleWorkflow> clients = getCamelContext().getRegistry().findByType(AmazonSimpleWorkflow.class);
diff --git a/components/camel-aws-swf/src/test/java/org/apache/camel/component/aws/swf/SWFComponentConfigurationTest.java b/components/camel-aws-swf/src/test/java/org/apache/camel/component/aws/swf/SWFComponentConfigurationTest.java
index 9a5da7f..0f4b883 100644
--- a/components/camel-aws-swf/src/test/java/org/apache/camel/component/aws/swf/SWFComponentConfigurationTest.java
+++ b/components/camel-aws-swf/src/test/java/org/apache/camel/component/aws/swf/SWFComponentConfigurationTest.java
@@ -25,8 +25,8 @@ public class SWFComponentConfigurationTest extends CamelTestSupport {
     @Test
     public void createEndpointWithComponentElements() throws Exception {
         SWFComponent component = context.getComponent("aws-swf", SWFComponent.class);
-        component.setAccessKey("XXX");
-        component.setSecretKey("YYY");
+        component.getConfiguration().setAccessKey("XXX");
+        component.getConfiguration().setSecretKey("YYY");
         SWFEndpoint endpoint = (SWFEndpoint)component.createEndpoint("aws-swf://workflow");
         
         assertEquals("workflow", endpoint.getConfiguration().getType());
@@ -37,9 +37,9 @@ public class SWFComponentConfigurationTest extends CamelTestSupport {
     @Test
     public void createEndpointWithComponentAndEndpointElements() throws Exception {
         SWFComponent component = context.getComponent("aws-swf", SWFComponent.class);
-        component.setAccessKey("XXX");
-        component.setSecretKey("YYY");
-        component.setRegion(Regions.US_WEST_1.toString());
+        component.getConfiguration().setAccessKey("XXX");
+        component.getConfiguration().setSecretKey("YYY");
+        component.getConfiguration().setRegion(Regions.US_WEST_1.toString());
         SWFEndpoint endpoint = (SWFEndpoint)component.createEndpoint("aws-swf://workflow?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1");
         
         assertEquals("workflow", endpoint.getConfiguration().getType());
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSwfComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSwfComponentBuilderFactory.java
index 201d66c..472d485 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSwfComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSwfComponentBuilderFactory.java
@@ -49,27 +49,30 @@ public interface AwsSwfComponentBuilderFactory {
      */
     interface AwsSwfComponentBuilder extends ComponentBuilder<SWFComponent> {
         /**
-         * Amazon AWS Access Key.
+         * To use the given AmazonSimpleWorkflowClient as client.
          * 
-         * The option is a: <code>java.lang.String</code> type.
+         * The option is a:
+         * <code>com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflow</code> type.
          * 
          * Group: common
          */
-        default AwsSwfComponentBuilder accessKey(java.lang.String accessKey) {
-            doSetProperty("accessKey", accessKey);
+        default AwsSwfComponentBuilder amazonSWClient(
+                com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflow amazonSWClient) {
+            doSetProperty("amazonSWClient", amazonSWClient);
             return this;
         }
         /**
-         * To use the given AmazonSimpleWorkflowClient as client.
+         * The component configuration.
          * 
          * The option is a:
-         * <code>com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflow</code> type.
+         * <code>org.apache.camel.component.aws.swf.SWFConfiguration</code>
+         * type.
          * 
          * Group: common
          */
-        default AwsSwfComponentBuilder amazonSWClient(
-                com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflow amazonSWClient) {
-            doSetProperty("amazonSWClient", amazonSWClient);
+        default AwsSwfComponentBuilder configuration(
+                org.apache.camel.component.aws.swf.SWFConfiguration configuration) {
+            doSetProperty("configuration", configuration);
             return this;
         }
         /**
@@ -124,17 +127,6 @@ public interface AwsSwfComponentBuilderFactory {
             return this;
         }
         /**
-         * Amazon AWS Secret Key.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Group: common
-         */
-        default AwsSwfComponentBuilder secretKey(java.lang.String secretKey) {
-            doSetProperty("secretKey", secretKey);
-            return this;
-        }
-        /**
          * The workflow or activity event version to use.
          * 
          * The option is a: <code>java.lang.String</code> type.
@@ -214,20 +206,6 @@ public interface AwsSwfComponentBuilderFactory {
             return this;
         }
         /**
-         * The AWS SWF default configuration.
-         * 
-         * The option is a:
-         * <code>org.apache.camel.component.aws.swf.SWFConfiguration</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AwsSwfComponentBuilder configuration(
-                org.apache.camel.component.aws.swf.SWFConfiguration configuration) {
-            doSetProperty("configuration", configuration);
-            return this;
-        }
-        /**
          * To configure the StartWorkflowOptions using the key/values from the
          * Map.
          * 
@@ -440,6 +418,28 @@ public interface AwsSwfComponentBuilderFactory {
             doSetProperty("workflowTypeRegistrationOptions", workflowTypeRegistrationOptions);
             return this;
         }
+        /**
+         * Amazon AWS Access Key.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: security
+         */
+        default AwsSwfComponentBuilder accessKey(java.lang.String accessKey) {
+            doSetProperty("accessKey", accessKey);
+            return this;
+        }
+        /**
+         * Amazon AWS Secret Key.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: security
+         */
+        default AwsSwfComponentBuilder secretKey(java.lang.String secretKey) {
+            doSetProperty("secretKey", secretKey);
+            return this;
+        }
     }
 
     class AwsSwfComponentBuilderImpl
@@ -464,19 +464,17 @@ public interface AwsSwfComponentBuilderFactory {
                 String name,
                 Object value) {
             switch (name) {
-            case "accessKey": ((SWFComponent) component).setAccessKey((java.lang.String) value); return true;
             case "amazonSWClient": getOrCreateConfiguration((SWFComponent) component).setAmazonSWClient((com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflow) value); return true;
+            case "configuration": ((SWFComponent) component).setConfiguration((org.apache.camel.component.aws.swf.SWFConfiguration) value); return true;
             case "dataConverter": getOrCreateConfiguration((SWFComponent) component).setDataConverter((com.amazonaws.services.simpleworkflow.flow.DataConverter) value); return true;
             case "domainName": getOrCreateConfiguration((SWFComponent) component).setDomainName((java.lang.String) value); return true;
             case "eventName": getOrCreateConfiguration((SWFComponent) component).setEventName((java.lang.String) value); return true;
             case "region": getOrCreateConfiguration((SWFComponent) component).setRegion((java.lang.String) value); return true;
-            case "secretKey": ((SWFComponent) component).setSecretKey((java.lang.String) value); return true;
             case "version": getOrCreateConfiguration((SWFComponent) component).setVersion((java.lang.String) value); return true;
             case "bridgeErrorHandler": ((SWFComponent) component).setBridgeErrorHandler((boolean) value); return true;
             case "lazyStartProducer": ((SWFComponent) component).setLazyStartProducer((boolean) value); return true;
             case "basicPropertyBinding": ((SWFComponent) component).setBasicPropertyBinding((boolean) value); return true;
             case "clientConfigurationParameters": getOrCreateConfiguration((SWFComponent) component).setClientConfigurationParameters((java.util.Map) value); return true;
-            case "configuration": ((SWFComponent) component).setConfiguration((org.apache.camel.component.aws.swf.SWFConfiguration) value); return true;
             case "startWorkflowOptionsParameters": getOrCreateConfiguration((SWFComponent) component).setStartWorkflowOptionsParameters((java.util.Map) value); return true;
             case "sWClientParameters": getOrCreateConfiguration((SWFComponent) component).setSWClientParameters((java.util.Map) value); return true;
             case "activityList": getOrCreateConfiguration((SWFComponent) component).setActivityList((java.lang.String) value); return true;
@@ -494,6 +492,8 @@ public interface AwsSwfComponentBuilderFactory {
             case "terminationReason": getOrCreateConfiguration((SWFComponent) component).setTerminationReason((java.lang.String) value); return true;
             case "workflowList": getOrCreateConfiguration((SWFComponent) component).setWorkflowList((java.lang.String) value); return true;
             case "workflowTypeRegistrationOptions": getOrCreateConfiguration((SWFComponent) component).setWorkflowTypeRegistrationOptions((com.amazonaws.services.simpleworkflow.flow.WorkflowTypeRegistrationOptions) value); return true;
+            case "accessKey": getOrCreateConfiguration((SWFComponent) component).setAccessKey((java.lang.String) value); return true;
+            case "secretKey": getOrCreateConfiguration((SWFComponent) component).setSecretKey((java.lang.String) value); return true;
             default: return false;
             }
         }


[camel] 03/04: CAMEL-14568 - Fixed AWS SQS

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 f979f7cc21ed1cce27f5b4ec84aa84ec26c7eeef
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Feb 28 16:51:55 2020 +0100

    CAMEL-14568 - Fixed AWS SQS
---
 .../component/aws/sqs/SqsComponentConfigurer.java  | 11 ++-
 .../apache/camel/component/aws/sqs/aws-sqs.json    |  8 +--
 .../src/main/docs/aws-sqs-component.adoc           |  6 +-
 .../camel/component/aws/sqs/SqsComponent.java      | 47 +------------
 .../aws/sqs/SqsComponentConfigurationTest.java     | 22 +++---
 .../dsl/AwsSqsComponentBuilderFactory.java         | 78 +++++++++++-----------
 6 files changed, 64 insertions(+), 108 deletions(-)

diff --git a/components/camel-aws-sqs/src/generated/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurer.java b/components/camel-aws-sqs/src/generated/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurer.java
index d183538..d13fbd2 100644
--- a/components/camel-aws-sqs/src/generated/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurer.java
+++ b/components/camel-aws-sqs/src/generated/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurer.java
@@ -22,23 +22,19 @@ public class SqsComponentConfigurer extends PropertyConfigurerSupport implements
     public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
         SqsComponent target = (SqsComponent) obj;
         switch (ignoreCase ? name.toLowerCase() : name) {
-        case "accesskey":
-        case "accessKey": target.setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
         case "amazonawshost":
         case "amazonAWSHost": getOrCreateConfiguration(target).setAmazonAWSHost(property(camelContext, java.lang.String.class, value)); return true;
         case "amazonsqsclient":
         case "amazonSQSClient": getOrCreateConfiguration(target).setAmazonSQSClient(property(camelContext, com.amazonaws.services.sqs.AmazonSQS.class, value)); return true;
         case "autocreatequeue":
         case "autoCreateQueue": getOrCreateConfiguration(target).setAutoCreateQueue(property(camelContext, boolean.class, value)); return true;
+        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws.sqs.SqsConfiguration.class, value)); return true;
         case "protocol": getOrCreateConfiguration(target).setProtocol(property(camelContext, java.lang.String.class, value)); return true;
         case "proxyprotocol":
         case "proxyProtocol": getOrCreateConfiguration(target).setProxyProtocol(property(camelContext, com.amazonaws.Protocol.class, value)); return true;
         case "queueownerawsaccountid":
         case "queueOwnerAWSAccountId": getOrCreateConfiguration(target).setQueueOwnerAWSAccountId(property(camelContext, java.lang.String.class, value)); return true;
-        case "region": target.setRegion(property(camelContext, java.lang.String.class, value)); return true;
         case "region": getOrCreateConfiguration(target).setRegion(property(camelContext, java.lang.String.class, value)); return true;
-        case "secretkey":
-        case "secretKey": target.setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
         case "attributenames":
         case "attributeNames": getOrCreateConfiguration(target).setAttributeNames(property(camelContext, java.lang.String.class, value)); return true;
         case "bridgeerrorhandler":
@@ -76,7 +72,6 @@ public class SqsComponentConfigurer extends PropertyConfigurerSupport implements
         case "operation": getOrCreateConfiguration(target).setOperation(property(camelContext, org.apache.camel.component.aws.sqs.SqsOperations.class, value)); return true;
         case "basicpropertybinding":
         case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
-        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws.sqs.SqsConfiguration.class, value)); return true;
         case "delayqueue":
         case "delayQueue": getOrCreateConfiguration(target).setDelayQueue(property(camelContext, boolean.class, value)); return true;
         case "queueurl":
@@ -94,6 +89,10 @@ public class SqsComponentConfigurer extends PropertyConfigurerSupport implements
         case "receiveMessageWaitTimeSeconds": getOrCreateConfiguration(target).setReceiveMessageWaitTimeSeconds(property(camelContext, java.lang.Integer.class, value)); return true;
         case "redrivepolicy":
         case "redrivePolicy": getOrCreateConfiguration(target).setRedrivePolicy(property(camelContext, java.lang.String.class, value)); return true;
+        case "accesskey":
+        case "accessKey": getOrCreateConfiguration(target).setAccessKey(property(camelContext, java.lang.String.class, value)); return true;
+        case "secretkey":
+        case "secretKey": getOrCreateConfiguration(target).setSecretKey(property(camelContext, java.lang.String.class, value)); return true;
         default: return false;
         }
     }
diff --git a/components/camel-aws-sqs/src/generated/resources/org/apache/camel/component/aws/sqs/aws-sqs.json b/components/camel-aws-sqs/src/generated/resources/org/apache/camel/component/aws/sqs/aws-sqs.json
index b1ec43f..2350062 100644
--- a/components/camel-aws-sqs/src/generated/resources/org/apache/camel/component/aws/sqs/aws-sqs.json
+++ b/components/camel-aws-sqs/src/generated/resources/org/apache/camel/component/aws/sqs/aws-sqs.json
@@ -19,15 +19,14 @@
     "version": "3.2.0-SNAPSHOT"
   },
   "componentProperties": {
-    "accessKey": { "kind": "property", "displayName": "Access Key", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Amazon AWS Access Key" },
     "amazonAWSHost": { "kind": "property", "displayName": "Amazon AWSHost", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "amazonaws.com", "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "The hostname of the Amazon AWS cloud." },
     "amazonSQSClient": { "kind": "property", "displayName": "Amazon SQSClient", "group": "common", "label": "", "required": false, "type": "object", "javaType": "com.amazonaws.services.sqs.AmazonSQS", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "To use the AmazonSQS as client" },
     "autoCreateQueue": { "kind": "property", "displayName": "Auto Create Queue", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "Setting the autocreation of the queue" },
+    "configuration": { "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws.sqs.SqsConfiguration", "deprecated": false, "secret": false, "description": "The component configuration" },
     "protocol": { "kind": "property", "displayName": "Protocol", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "defaultValue": "https", "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "The underlying protocol used to communicate with SQS" },
     "proxyProtocol": { "kind": "property", "displayName": "Proxy Protocol", "group": "common", "label": "", "required": false, "type": "object", "javaType": "com.amazonaws.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating the SQS client" },
     "queueOwnerAWSAccountId": { "kind": "property", "displayName": "Queue Owner AWSAccount Id", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "Specify the queue owner aws account id when you need to connect the queue with different account owner." },
     "region": { "kind": "property", "displayName": "Region", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "Specify the queue region which could be used with queueOwnerAWSAccountId to build the service URL. When using this parameter, the configuration will expect the  [...]
-    "secretKey": { "kind": "property", "displayName": "Secret Key", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "description": "Amazon AWS Secret Key" },
     "attributeNames": { "kind": "property", "displayName": "Attribute Names", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "A list of attribute names to receive when consuming. Multiple names can be separated by comma." },
     "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 message and handled by [...]
     "concurrentConsumers": { "kind": "property", "displayName": "Concurrent Consumers", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "1", "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "Allows you to use multiple threads to poll the sqs queue to increase throughput" },
@@ -47,7 +46,6 @@
     "messageGroupIdStrategy": { "kind": "property", "displayName": "Message Group Id Strategy", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "useConstant", "useExchangeId", "usePropertyValue" ], "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "Only for FIFO queues. Strategy for setting the mess [...]
     "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws.sqs.SqsOperations", "enum": [ "sendBatchMessage", "deleteMessage", "listQueues" ], "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "The operation to do in case the user don't want t [...]
     "basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
-    "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws.sqs.SqsConfiguration", "deprecated": false, "secret": false, "description": "The AWS SQS default configuration" },
     "delayQueue": { "kind": "property", "displayName": "Delay Queue", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "Define if you want to apply delaySeconds option to the queue or on single messages" },
     "queueUrl": { "kind": "property", "displayName": "Queue Url", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "To define the queueUrl explicitly. All other parameters, which would influence the queueUrl, are ignored. This parameter is intended to be used,  [...]
     "proxyHost": { "kind": "property", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the SQS client" },
@@ -56,7 +54,9 @@
     "messageRetentionPeriod": { "kind": "property", "displayName": "Message Retention Period", "group": "queue", "label": "queue", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "The messageRetentionPeriod (in seconds) a message will be retained by SQS for this queue." },
     "policy": { "kind": "property", "displayName": "Policy", "group": "queue", "label": "queue", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "The policy for this queue" },
     "receiveMessageWaitTimeSeconds": { "kind": "property", "displayName": "Receive Message Wait Time Seconds", "group": "queue", "label": "queue", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "If you do not specify WaitTimeSeconds in the request, the queue attribute ReceiveMessageWaitTimeSeconds  [...]
-    "redrivePolicy": { "kind": "property", "displayName": "Redrive Policy", "group": "queue", "label": "queue", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "Specify the policy that send message to DeadLetter queue. See detail at Amazon docs." }
+    "redrivePolicy": { "kind": "property", "displayName": "Redrive Policy", "group": "queue", "label": "queue", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "Specify the policy that send message to DeadLetter queue. See detail at Amazon docs." },
+    "accessKey": { "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
+    "secretKey": { "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.sqs.SqsConfiguration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
   },
   "properties": {
     "queueNameOrArn": { "kind": "path", "displayName": "Queue Name Or Arn", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "description": "Queue name or ARN" },
diff --git a/components/camel-aws-sqs/src/main/docs/aws-sqs-component.adoc b/components/camel-aws-sqs/src/main/docs/aws-sqs-component.adoc
index 0c59448..7e047a6 100644
--- a/components/camel-aws-sqs/src/main/docs/aws-sqs-component.adoc
+++ b/components/camel-aws-sqs/src/main/docs/aws-sqs-component.adoc
@@ -38,15 +38,14 @@ The AWS Simple Queue Service component supports 38 options, which are listed bel
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *accessKey* (common) | Amazon AWS Access Key |  | String
 | *amazonAWSHost* (common) | The hostname of the Amazon AWS cloud. | amazonaws.com | String
 | *amazonSQSClient* (common) | To use the AmazonSQS as client |  | AmazonSQS
 | *autoCreateQueue* (common) | Setting the autocreation of the queue | true | boolean
+| *configuration* (common) | The component configuration |  | SqsConfiguration
 | *protocol* (common) | The underlying protocol used to communicate with SQS | https | String
 | *proxyProtocol* (common) | To define a proxy protocol when instantiating the SQS client. The value can be one of: HTTP, HTTPS | HTTPS | Protocol
 | *queueOwnerAWSAccountId* (common) | Specify the queue owner aws account id when you need to connect the queue with different account owner. |  | String
 | *region* (common) | Specify the queue region which could be used with queueOwnerAWSAccountId to build the service URL. When using this parameter, the configuration will expect the capitalized name of the region (for example AP_EAST_1) You'll need to use the name Regions.EU_WEST_1.name() |  | String
-| *secretKey* (common) | Amazon AWS Secret Key |  | String
 | *attributeNames* (consumer) | A list of attribute names to receive when consuming. Multiple names can be separated by comma. |  | 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
 | *concurrentConsumers* (consumer) | Allows you to use multiple threads to poll the sqs queue to increase throughput | 1 | int
@@ -66,7 +65,6 @@ The AWS Simple Queue Service component supports 38 options, which are listed bel
 | *messageGroupIdStrategy* (producer) | Only for FIFO queues. Strategy for setting the messageGroupId on the message. Can be one of the following options: useConstant, useExchangeId, usePropertyValue. For the usePropertyValue option, the value of property CamelAwsMessageGroupId will be used. The value can be one of: useConstant, useExchangeId, usePropertyValue |  | String
 | *operation* (producer) | The operation to do in case the user don't want to send only a message. The value can be one of: sendBatchMessage, deleteMessage, listQueues |  | SqsOperations
 | *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
-| *configuration* (advanced) | The AWS SQS default configuration |  | SqsConfiguration
 | *delayQueue* (advanced) | Define if you want to apply delaySeconds option to the queue or on single messages | false | boolean
 | *queueUrl* (advanced) | To define the queueUrl explicitly. All other parameters, which would influence the queueUrl, are ignored. This parameter is intended to be used, to connect to a mock implementation of SQS, for testing purposes. |  | String
 | *proxyHost* (proxy) | To define a proxy host when instantiating the SQS client |  | String
@@ -76,6 +74,8 @@ The AWS Simple Queue Service component supports 38 options, which are listed bel
 | *policy* (queue) | The policy for this queue |  | String
 | *receiveMessageWaitTimeSeconds* (queue) | If you do not specify WaitTimeSeconds in the request, the queue attribute ReceiveMessageWaitTimeSeconds is used to determine how long to wait. |  | Integer
 | *redrivePolicy* (queue) | Specify the policy that send message to DeadLetter queue. See detail at Amazon docs. |  | String
+| *accessKey* (security) | Amazon AWS Access Key |  | String
+| *secretKey* (security) | Amazon AWS Secret Key |  | String
 |===
 // component options: END
 
diff --git a/components/camel-aws-sqs/src/main/java/org/apache/camel/component/aws/sqs/SqsComponent.java b/components/camel-aws-sqs/src/main/java/org/apache/camel/component/aws/sqs/SqsComponent.java
index 79c564b..ec5cbd7 100644
--- a/components/camel-aws-sqs/src/main/java/org/apache/camel/component/aws/sqs/SqsComponent.java
+++ b/components/camel-aws-sqs/src/main/java/org/apache/camel/component/aws/sqs/SqsComponent.java
@@ -31,13 +31,7 @@ import org.apache.camel.support.DefaultComponent;
 public class SqsComponent extends DefaultComponent {
 
     @Metadata
-    private String accessKey;
-    @Metadata
-    private String secretKey;
-    @Metadata
-    private String region;
-    @Metadata(label = "advanced")
-    private SqsConfiguration configuration;
+    private SqsConfiguration configuration = new SqsConfiguration();
 
     public SqsComponent() {
         this(null);
@@ -68,9 +62,6 @@ public class SqsComponent extends DefaultComponent {
             configuration.setQueueName(remaining);
         }
         SqsEndpoint sqsEndpoint = new SqsEndpoint(uri, this, configuration);
-        sqsEndpoint.getConfiguration().setAccessKey(accessKey);
-        sqsEndpoint.getConfiguration().setSecretKey(secretKey);
-        sqsEndpoint.getConfiguration().setRegion(region);
         setProperties(sqsEndpoint, parameters);
         checkAndSetRegistryClient(configuration);
         if (configuration.getAmazonSQSClient() == null && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
@@ -90,46 +81,12 @@ public class SqsComponent extends DefaultComponent {
     }
 
     /**
-     * The AWS SQS default configuration
+     * The component configuration
      */
     public void setConfiguration(SqsConfiguration configuration) {
         this.configuration = configuration;
     }
 
-    public String getAccessKey() {
-        return accessKey;
-    }
-
-    /**
-     * Amazon AWS Access Key
-     */
-    public void setAccessKey(String accessKey) {
-        this.accessKey = accessKey;
-    }
-
-    public String getSecretKey() {
-        return secretKey;
-    }
-
-    /**
-     * Amazon AWS Secret Key
-     */
-    public void setSecretKey(String secretKey) {
-        this.secretKey = secretKey;
-    }
-
-    public String getRegion() {
-        return region;
-    }
-
-    /**
-     * Specify the queue region which could be used with queueOwnerAWSAccountId
-     * to build the service URL.
-     */
-    public void setRegion(String region) {
-        this.region = region;
-    }
-
     private void checkAndSetRegistryClient(SqsConfiguration configuration) {
         Set<AmazonSQS> clients = getCamelContext().getRegistry().findByType(AmazonSQS.class);
         if (clients.size() == 1) {
diff --git a/components/camel-aws-sqs/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java b/components/camel-aws-sqs/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java
index 4ce3e46..c01fb99 100644
--- a/components/camel-aws-sqs/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java
+++ b/components/camel-aws-sqs/src/test/java/org/apache/camel/component/aws/sqs/SqsComponentConfigurationTest.java
@@ -246,8 +246,8 @@ public class SqsComponentConfigurationTest extends CamelTestSupport {
 
         context.getRegistry().bind("amazonSQSClient", mock);
         SqsComponent component = context.getComponent("aws-sqs", SqsComponent.class);
-        component.setAccessKey("XXX");
-        component.setSecretKey("YYY");
+        component.getConfiguration().setAccessKey("XXX");
+        component.getConfiguration().setSecretKey("YYY");
         SqsEndpoint endpoint = (SqsEndpoint)component.createEndpoint("aws-sqs://MyQueue?amazonSQSClient=#amazonSQSClient");
 
         assertEquals("MyQueue", endpoint.getConfiguration().getQueueName());
@@ -258,9 +258,9 @@ public class SqsComponentConfigurationTest extends CamelTestSupport {
     @Test
     public void createEndpointWithComponentAndEndpointElements() throws Exception {
         SqsComponent component = context.getComponent("aws-sqs", SqsComponent.class);
-        component.setAccessKey("XXX");
-        component.setSecretKey("YYY");
-        component.setRegion(Regions.US_WEST_1.toString());
+        component.getConfiguration().setAccessKey("XXX");
+        component.getConfiguration().setSecretKey("YYY");
+        component.getConfiguration().setRegion(Regions.US_WEST_1.toString());
         SqsEndpoint endpoint = (SqsEndpoint)component.createEndpoint("aws-sqs://MyQueue?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1");
 
         assertEquals("MyQueue", endpoint.getConfiguration().getQueueName());
@@ -272,9 +272,9 @@ public class SqsComponentConfigurationTest extends CamelTestSupport {
     @Test
     public void createEndpointWithoutAutoCreation() throws Exception {
         SqsComponent component = context.getComponent("aws-sqs", SqsComponent.class);
-        component.setAccessKey("XXX");
-        component.setSecretKey("YYY");
-        component.setRegion(Regions.US_WEST_1.toString());
+        component.getConfiguration().setAccessKey("XXX");
+        component.getConfiguration().setSecretKey("YYY");
+        component.getConfiguration().setRegion(Regions.US_WEST_1.toString());
         SqsEndpoint endpoint = (SqsEndpoint)component.createEndpoint("aws-sqs://MyQueue?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1&autoCreateQueue=false");
 
         assertEquals("MyQueue", endpoint.getConfiguration().getQueueName());
@@ -287,9 +287,9 @@ public class SqsComponentConfigurationTest extends CamelTestSupport {
     @Test
     public void createEndpointWithComponentEndpointElementsAndProxy() throws Exception {
         SqsComponent component = context.getComponent("aws-sqs", SqsComponent.class);
-        component.setAccessKey("XXX");
-        component.setSecretKey("YYY");
-        component.setRegion(Regions.US_WEST_1.toString());
+        component.getConfiguration().setAccessKey("XXX");
+        component.getConfiguration().setSecretKey("YYY");
+        component.getConfiguration().setRegion(Regions.US_WEST_1.toString());
         SqsEndpoint endpoint = (SqsEndpoint)component.createEndpoint("aws-sqs://label?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1&proxyHost=localhost&proxyPort=9000&proxyProtocol=HTTP");
         
         assertEquals("xxxxxx", endpoint.getConfiguration().getAccessKey());
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSqsComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSqsComponentBuilderFactory.java
index 8f09070..92654bd 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSqsComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AwsSqsComponentBuilderFactory.java
@@ -49,17 +49,6 @@ public interface AwsSqsComponentBuilderFactory {
      */
     interface AwsSqsComponentBuilder extends ComponentBuilder<SqsComponent> {
         /**
-         * Amazon AWS Access Key.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Group: common
-         */
-        default AwsSqsComponentBuilder accessKey(java.lang.String accessKey) {
-            doSetProperty("accessKey", accessKey);
-            return this;
-        }
-        /**
          * The hostname of the Amazon AWS cloud.
          * 
          * The option is a: <code>java.lang.String</code> type.
@@ -98,6 +87,20 @@ public interface AwsSqsComponentBuilderFactory {
             return this;
         }
         /**
+         * The component configuration.
+         * 
+         * The option is a:
+         * <code>org.apache.camel.component.aws.sqs.SqsConfiguration</code>
+         * type.
+         * 
+         * Group: common
+         */
+        default AwsSqsComponentBuilder configuration(
+                org.apache.camel.component.aws.sqs.SqsConfiguration configuration) {
+            doSetProperty("configuration", configuration);
+            return this;
+        }
+        /**
          * The underlying protocol used to communicate with SQS.
          * 
          * The option is a: <code>java.lang.String</code> type.
@@ -151,17 +154,6 @@ public interface AwsSqsComponentBuilderFactory {
             return this;
         }
         /**
-         * Amazon AWS Secret Key.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Group: common
-         */
-        default AwsSqsComponentBuilder secretKey(java.lang.String secretKey) {
-            doSetProperty("secretKey", secretKey);
-            return this;
-        }
-        /**
          * A list of attribute names to receive when consuming. Multiple names
          * can be separated by comma.
          * 
@@ -439,20 +431,6 @@ public interface AwsSqsComponentBuilderFactory {
             return this;
         }
         /**
-         * The AWS SQS default configuration.
-         * 
-         * The option is a:
-         * <code>org.apache.camel.component.aws.sqs.SqsConfiguration</code>
-         * type.
-         * 
-         * Group: advanced
-         */
-        default AwsSqsComponentBuilder configuration(
-                org.apache.camel.component.aws.sqs.SqsConfiguration configuration) {
-            doSetProperty("configuration", configuration);
-            return this;
-        }
-        /**
          * Define if you want to apply delaySeconds option to the queue or on
          * single messages.
          * 
@@ -565,6 +543,28 @@ public interface AwsSqsComponentBuilderFactory {
             doSetProperty("redrivePolicy", redrivePolicy);
             return this;
         }
+        /**
+         * Amazon AWS Access Key.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: security
+         */
+        default AwsSqsComponentBuilder accessKey(java.lang.String accessKey) {
+            doSetProperty("accessKey", accessKey);
+            return this;
+        }
+        /**
+         * Amazon AWS Secret Key.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: security
+         */
+        default AwsSqsComponentBuilder secretKey(java.lang.String secretKey) {
+            doSetProperty("secretKey", secretKey);
+            return this;
+        }
     }
 
     class AwsSqsComponentBuilderImpl
@@ -589,15 +589,14 @@ public interface AwsSqsComponentBuilderFactory {
                 String name,
                 Object value) {
             switch (name) {
-            case "accessKey": ((SqsComponent) component).setAccessKey((java.lang.String) value); return true;
             case "amazonAWSHost": getOrCreateConfiguration((SqsComponent) component).setAmazonAWSHost((java.lang.String) value); return true;
             case "amazonSQSClient": getOrCreateConfiguration((SqsComponent) component).setAmazonSQSClient((com.amazonaws.services.sqs.AmazonSQS) value); return true;
             case "autoCreateQueue": getOrCreateConfiguration((SqsComponent) component).setAutoCreateQueue((boolean) value); return true;
+            case "configuration": ((SqsComponent) component).setConfiguration((org.apache.camel.component.aws.sqs.SqsConfiguration) value); return true;
             case "protocol": getOrCreateConfiguration((SqsComponent) component).setProtocol((java.lang.String) value); return true;
             case "proxyProtocol": getOrCreateConfiguration((SqsComponent) component).setProxyProtocol((com.amazonaws.Protocol) value); return true;
             case "queueOwnerAWSAccountId": getOrCreateConfiguration((SqsComponent) component).setQueueOwnerAWSAccountId((java.lang.String) value); return true;
             case "region": getOrCreateConfiguration((SqsComponent) component).setRegion((java.lang.String) value); return true;
-            case "secretKey": ((SqsComponent) component).setSecretKey((java.lang.String) value); return true;
             case "attributeNames": getOrCreateConfiguration((SqsComponent) component).setAttributeNames((java.lang.String) value); return true;
             case "bridgeErrorHandler": ((SqsComponent) component).setBridgeErrorHandler((boolean) value); return true;
             case "concurrentConsumers": getOrCreateConfiguration((SqsComponent) component).setConcurrentConsumers((int) value); return true;
@@ -617,7 +616,6 @@ public interface AwsSqsComponentBuilderFactory {
             case "messageGroupIdStrategy": getOrCreateConfiguration((SqsComponent) component).setMessageGroupIdStrategy((java.lang.String) value); return true;
             case "operation": getOrCreateConfiguration((SqsComponent) component).setOperation((org.apache.camel.component.aws.sqs.SqsOperations) value); return true;
             case "basicPropertyBinding": ((SqsComponent) component).setBasicPropertyBinding((boolean) value); return true;
-            case "configuration": ((SqsComponent) component).setConfiguration((org.apache.camel.component.aws.sqs.SqsConfiguration) value); return true;
             case "delayQueue": getOrCreateConfiguration((SqsComponent) component).setDelayQueue((boolean) value); return true;
             case "queueUrl": getOrCreateConfiguration((SqsComponent) component).setQueueUrl((java.lang.String) value); return true;
             case "proxyHost": getOrCreateConfiguration((SqsComponent) component).setProxyHost((java.lang.String) value); return true;
@@ -627,6 +625,8 @@ public interface AwsSqsComponentBuilderFactory {
             case "policy": getOrCreateConfiguration((SqsComponent) component).setPolicy((java.lang.String) value); return true;
             case "receiveMessageWaitTimeSeconds": getOrCreateConfiguration((SqsComponent) component).setReceiveMessageWaitTimeSeconds((java.lang.Integer) value); return true;
             case "redrivePolicy": getOrCreateConfiguration((SqsComponent) component).setRedrivePolicy((java.lang.String) value); return true;
+            case "accessKey": getOrCreateConfiguration((SqsComponent) component).setAccessKey((java.lang.String) value); return true;
+            case "secretKey": getOrCreateConfiguration((SqsComponent) component).setSecretKey((java.lang.String) value); return true;
             default: return false;
             }
         }