This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new 1fa7237 CAMEL-14568 - Fixed camel-aws2-kinesis 1fa7237 is described below commit 1fa7237d3411feaf5cfba9546f294f7912c098e6 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Sat Feb 29 09:28:58 2020 +0100 CAMEL-14568 - Fixed camel-aws2-kinesis --- .../KinesisFirehose2ComponentConfigurer.java | 11 ++-- .../aws2/kinesis/Kinesis2ComponentConfigurer.java | 11 ++-- .../aws2/firehose/aws2-kinesis-firehose.json | 6 +- .../camel/component/aws2/kinesis/aws2-kinesis.json | 6 +- .../src/main/docs/aws2-kinesis-component.adoc | 6 +- .../main/docs/aws2-kinesis-firehose-component.adoc | 6 +- .../aws2/firehose/KinesisFirehose2Component.java | 46 +-------------- .../component/aws2/kinesis/Kinesis2Component.java | 46 +-------------- .../KinesisFirehoseComponentConfigurationTest.java | 16 ++--- .../kinesis/KinesisComponentConfigurationTest.java | 16 ++--- .../dsl/Aws2KinesisComponentBuilderFactory.java | 62 ++++++++++---------- ...Aws2KinesisFirehoseComponentBuilderFactory.java | 68 +++++++++++----------- 12 files changed, 107 insertions(+), 193 deletions(-) diff --git a/components/camel-aws2-kinesis/src/generated/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2ComponentConfigurer.java b/components/camel-aws2-kinesis/src/generated/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2ComponentConfigurer.java index d0b963c..a510f80 100644 --- a/components/camel-aws2-kinesis/src/generated/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2ComponentConfigurer.java +++ b/components/camel-aws2-kinesis/src/generated/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2ComponentConfigurer.java @@ -22,10 +22,9 @@ public class KinesisFirehose2ComponentConfigurer extends PropertyConfigurerSuppo public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { KinesisFirehose2Component target = (KinesisFirehose2Component) obj; switch (ignoreCase ? name.toLowerCase() : name) { - case "accesskey": - case "accessKey": target.setAccessKey(property(camelContext, java.lang.String.class, value)); return true; case "amazonkinesisfirehoseclient": case "amazonKinesisFirehoseClient": getOrCreateConfiguration(target).setAmazonKinesisFirehoseClient(property(camelContext, software.amazon.awssdk.services.firehose.FirehoseClient.class, value)); return true; + case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws2.firehose.KinesisFirehose2Configuration.class, value)); return true; case "lazystartproducer": case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; case "proxyhost": @@ -34,13 +33,13 @@ public class KinesisFirehose2ComponentConfigurer extends PropertyConfigurerSuppo case "proxyPort": getOrCreateConfiguration(target).setProxyPort(property(camelContext, java.lang.Integer.class, value)); return true; case "proxyprotocol": case "proxyProtocol": getOrCreateConfiguration(target).setProxyProtocol(property(camelContext, software.amazon.awssdk.core.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 "secretkey": - case "secretKey": target.setSecretKey(property(camelContext, java.lang.String.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.aws2.firehose.KinesisFirehose2Configuration.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-aws2-kinesis/src/generated/java/org/apache/camel/component/aws2/kinesis/Kinesis2ComponentConfigurer.java b/components/camel-aws2-kinesis/src/generated/java/org/apache/camel/component/aws2/kinesis/Kinesis2ComponentConfigurer.java index 4729425..9d09d0f 100644 --- a/components/camel-aws2-kinesis/src/generated/java/org/apache/camel/component/aws2/kinesis/Kinesis2ComponentConfigurer.java +++ b/components/camel-aws2-kinesis/src/generated/java/org/apache/camel/component/aws2/kinesis/Kinesis2ComponentConfigurer.java @@ -22,20 +22,16 @@ public class Kinesis2ComponentConfigurer extends PropertyConfigurerSupport imple public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { Kinesis2Component target = (Kinesis2Component) obj; switch (ignoreCase ? name.toLowerCase() : name) { - case "accesskey": - case "accessKey": target.setAccessKey(property(camelContext, java.lang.String.class, value)); return true; case "amazonkinesisclient": case "amazonKinesisClient": getOrCreateConfiguration(target).setAmazonKinesisClient(property(camelContext, software.amazon.awssdk.services.kinesis.KinesisClient.class, value)); return true; + case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws2.kinesis.Kinesis2Configuration.class, value)); return true; case "proxyhost": case "proxyHost": getOrCreateConfiguration(target).setProxyHost(property(camelContext, java.lang.String.class, value)); return true; case "proxyport": case "proxyPort": getOrCreateConfiguration(target).setProxyPort(property(camelContext, java.lang.Integer.class, value)); return true; case "proxyprotocol": case "proxyProtocol": getOrCreateConfiguration(target).setProxyProtocol(property(camelContext, software.amazon.awssdk.core.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 "secretkey": - case "secretKey": target.setSecretKey(property(camelContext, java.lang.String.class, value)); return true; case "bridgeerrorhandler": case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true; case "iteratortype": @@ -52,7 +48,10 @@ public class Kinesis2ComponentConfigurer extends PropertyConfigurerSupport imple case "lazyStartProducer": target.setLazyStartProducer(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.aws2.kinesis.Kinesis2Configuration.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-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/firehose/aws2-kinesis-firehose.json b/components/camel-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/firehose/aws2-kinesis-firehose.json index 0c8c853..b6c4010 100644 --- a/components/camel-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/firehose/aws2-kinesis-firehose.json +++ b/components/camel-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/firehose/aws2-kinesis-firehose.json @@ -19,16 +19,16 @@ "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" }, "amazonKinesisFirehoseClient": { "kind": "property", "displayName": "Amazon Kinesis Firehose Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.firehose.FirehoseClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.firehose.KinesisFirehose2Configuration", "configurationField": "configuration", "description": "Amazon Kinesis Firehose client to use for all requests [...] + "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.firehose.KinesisFirehose2Configuration", "deprecated": false, "secret": false, "description": "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.aws2.firehose.KinesisFirehose2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Kinesis Firehose 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.aws2.firehose.KinesisFirehose2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Kinesis Firehose client" }, "proxyProtocol": { "kind": "property", "displayName": "Proxy Protocol", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.firehose.KinesisFirehose2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating the [...] "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.aws2.firehose.KinesisFirehose2Configuration", "configurationField": "configuration", "description": "The region in which Kinesis Firehose client needs to work. When using this parameter, the configuration will expect the lowercase name of t [...] - "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" }, "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.aws2.firehose.KinesisFirehose2Configuration", "deprecated": false, "secret": false, "description": "The AWS Kinesis Firehose 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.aws2.firehose.KinesisFirehose2Configuration", "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.aws2.firehose.KinesisFirehose2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" } }, "properties": { "streamName": { "kind": "path", "displayName": "Stream Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.aws2.firehose.KinesisFirehose2Configuration", "configurationField": "configuration", "description": "Name of the stream" }, diff --git a/components/camel-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/kinesis/aws2-kinesis.json b/components/camel-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/kinesis/aws2-kinesis.json index 391b5d9..ea7e19a 100644 --- a/components/camel-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/kinesis/aws2-kinesis.json +++ b/components/camel-aws2-kinesis/src/generated/resources/org/apache/camel/component/aws2/kinesis/aws2-kinesis.json @@ -19,13 +19,12 @@ "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" }, "amazonKinesisClient": { "kind": "property", "displayName": "Amazon Kinesis Client", "group": "common", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.kinesis.KinesisClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.kinesis.Kinesis2Configuration", "configurationField": "configuration", "description": "Amazon Kinesis client to use for all requests for this endpoint" }, + "configuration": { "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.kinesis.Kinesis2Configuration", "deprecated": false, "secret": false, "description": "Component configuration" }, "proxyHost": { "kind": "property", "displayName": "Proxy Host", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.kinesis.Kinesis2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Kinesis client" }, "proxyPort": { "kind": "property", "displayName": "Proxy Port", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.kinesis.Kinesis2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Kinesis client" }, "proxyProtocol": { "kind": "property", "displayName": "Proxy Protocol", "group": "common", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.kinesis.Kinesis2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating the Kinesis client" }, "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.aws2.kinesis.Kinesis2Configuration", "configurationField": "configuration", "description": "The region in which Kinesis Firehose client needs to work. When using this parameter, the configuration will expect the lowercase name of the region ( [...] - "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" }, "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 [...] "iteratorType": { "kind": "property", "displayName": "Iterator Type", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.kinesis.model.ShardIteratorType", "enum": [ "AT_SEQUENCE_NUMBER", "AFTER_SEQUENCE_NUMBER", "TRIM_HORIZON", "LATEST", "AT_TIMESTAMP", "null" ], "deprecated": false, "secret": false, "defaultValue": "TRIM_HORIZON", "configurationClass": "org.apache.camel.component.aws2.kinesis.Kinesis2Configurat [...] "maxResultsPerRequest": { "kind": "property", "displayName": "Max Results Per Request", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "defaultValue": "1", "configurationClass": "org.apache.camel.component.aws2.kinesis.Kinesis2Configuration", "configurationField": "configuration", "description": "Maximum number of records that will be fetched in each poll" }, @@ -34,7 +33,8 @@ "shardId": { "kind": "property", "displayName": "Shard Id", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.kinesis.Kinesis2Configuration", "configurationField": "configuration", "description": "Defines which shardId in the Kinesis stream to get records from" }, "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" }, - "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.kinesis.Kinesis2Configuration", "deprecated": false, "secret": false, "description": "The AWS S3 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.aws2.kinesis.Kinesis2Configuration", "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.aws2.kinesis.Kinesis2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" } }, "properties": { "streamName": { "kind": "path", "displayName": "Stream Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.aws2.kinesis.Kinesis2Configuration", "configurationField": "configuration", "description": "Name of the stream" }, diff --git a/components/camel-aws2-kinesis/src/main/docs/aws2-kinesis-component.adoc b/components/camel-aws2-kinesis/src/main/docs/aws2-kinesis-component.adoc index 1eb8c4c..b1ad84e 100644 --- a/components/camel-aws2-kinesis/src/main/docs/aws2-kinesis-component.adoc +++ b/components/camel-aws2-kinesis/src/main/docs/aws2-kinesis-component.adoc @@ -43,13 +43,12 @@ The AWS 2 Kinesis component supports 16 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 | *amazonKinesisClient* (common) | Amazon Kinesis client to use for all requests for this endpoint | | KinesisClient +| *configuration* (common) | Component configuration | | Kinesis2Configuration | *proxyHost* (common) | To define a proxy host when instantiating the Kinesis client | | String | *proxyPort* (common) | To define a proxy port when instantiating the Kinesis client | | Integer | *proxyProtocol* (common) | To define a proxy protocol when instantiating the Kinesis client. The value can be one of: HTTP, HTTPS | HTTPS | Protocol | *region* (common) | The region in which Kinesis Firehose client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU_WEST_1.id() | | String -| *secretKey* (common) | Amazon AWS Secret Key | | 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 | *iteratorType* (consumer) | Defines where in the Kinesis stream to start getting records. The value can be one of: AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, TRIM_HORIZON, LATEST, AT_TIMESTAMP, null | TRIM_HORIZON | ShardIteratorType | *maxResultsPerRequest* (consumer) | Maximum number of records that will be fetched in each poll | 1 | int @@ -58,7 +57,8 @@ The AWS 2 Kinesis component supports 16 options, which are listed below. | *shardId* (consumer) | Defines which shardId in the Kinesis stream to get records from | | 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 [...] | *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 S3 default configuration | | Kinesis2Configuration +| *accessKey* (security) | Amazon AWS Access Key | | String +| *secretKey* (security) | Amazon AWS Secret Key | | String |=== // component options: END diff --git a/components/camel-aws2-kinesis/src/main/docs/aws2-kinesis-firehose-component.adoc b/components/camel-aws2-kinesis/src/main/docs/aws2-kinesis-firehose-component.adoc index 66411a8..f703c73 100644 --- a/components/camel-aws2-kinesis/src/main/docs/aws2-kinesis-firehose-component.adoc +++ b/components/camel-aws2-kinesis/src/main/docs/aws2-kinesis-firehose-component.adoc @@ -42,16 +42,16 @@ The AWS 2 Kinesis Firehose component supports 10 options, which are listed below [width="100%",cols="2,5,^1,2",options="header"] |=== | Name | Description | Default | Type -| *accessKey* (producer) | Amazon AWS Access Key | | String | *amazonKinesisFirehoseClient* (producer) | Amazon Kinesis Firehose client to use for all requests for this endpoint | | FirehoseClient +| *configuration* (producer) | Component configuration | | KinesisFirehose2Configuration | *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 Kinesis Firehose client | | String | *proxyPort* (producer) | To define a proxy port when instantiating the Kinesis Firehose client | | Integer | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the Kinesis Firehose client. The value can be one of: HTTP, HTTPS | HTTPS | Protocol | *region* (producer) | The region in which Kinesis Firehose client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU_WEST_1.id() | | String -| *secretKey* (producer) | Amazon AWS Secret Key | | String | *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 Kinesis Firehose default configuration | | KinesisFirehose2Configuration +| *accessKey* (security) | Amazon AWS Access Key | | String +| *secretKey* (security) | Amazon AWS Secret Key | | String |=== // component options: END diff --git a/components/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Component.java b/components/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Component.java index f5393d8..e47f0df 100644 --- a/components/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Component.java +++ b/components/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Component.java @@ -30,13 +30,7 @@ import software.amazon.awssdk.services.firehose.FirehoseClient; public class KinesisFirehose2Component extends DefaultComponent { @Metadata - private String accessKey; - @Metadata - private String secretKey; - @Metadata - private String region; - @Metadata(label = "advanced") - private KinesisFirehose2Configuration configuration; + private KinesisFirehose2Configuration configuration = new KinesisFirehose2Configuration(); public KinesisFirehose2Component() { this(null); @@ -53,9 +47,6 @@ public class KinesisFirehose2Component extends DefaultComponent { KinesisFirehose2Configuration configuration = this.configuration != null ? this.configuration.copy() : new KinesisFirehose2Configuration(); configuration.setStreamName(remaining); KinesisFirehose2Endpoint endpoint = new KinesisFirehose2Endpoint(uri, configuration, this); - endpoint.getConfiguration().setAccessKey(accessKey); - endpoint.getConfiguration().setSecretKey(secretKey); - endpoint.getConfiguration().setRegion(region); setProperties(endpoint, parameters); checkAndSetRegistryClient(configuration); if (configuration.getAmazonKinesisFirehoseClient() == null && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) { @@ -69,45 +60,12 @@ public class KinesisFirehose2Component extends DefaultComponent { } /** - * The AWS Kinesis Firehose default configuration + * Component configuration */ public void setConfiguration(KinesisFirehose2Configuration 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(KinesisFirehose2Configuration configuration) { Set<FirehoseClient> clients = getCamelContext().getRegistry().findByType(FirehoseClient.class); if (clients.size() == 1) { diff --git a/components/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Component.java b/components/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Component.java index bc1870e..bcc779e 100644 --- a/components/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Component.java +++ b/components/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2Component.java @@ -30,13 +30,7 @@ import software.amazon.awssdk.services.kinesis.KinesisClient; public class Kinesis2Component extends DefaultComponent { @Metadata - private String accessKey; - @Metadata - private String secretKey; - @Metadata - private String region; - @Metadata(label = "advanced") - private Kinesis2Configuration configuration; + private Kinesis2Configuration configuration = new Kinesis2Configuration(); public Kinesis2Component() { this(null); @@ -53,9 +47,6 @@ public class Kinesis2Component extends DefaultComponent { Kinesis2Configuration configuration = this.configuration != null ? this.configuration.copy() : new Kinesis2Configuration(); configuration.setStreamName(remaining); Kinesis2Endpoint endpoint = new Kinesis2Endpoint(uri, configuration, this); - endpoint.getConfiguration().setAccessKey(accessKey); - endpoint.getConfiguration().setSecretKey(secretKey); - endpoint.getConfiguration().setRegion(region); setProperties(endpoint, parameters); checkAndSetRegistryClient(configuration); if (configuration.getAmazonKinesisClient() == null && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) { @@ -69,45 +60,12 @@ public class Kinesis2Component extends DefaultComponent { } /** - * The AWS S3 default configuration + * Component configuration */ public void setConfiguration(Kinesis2Configuration 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(Kinesis2Configuration configuration) { Set<KinesisClient> clients = getCamelContext().getRegistry().findByType(KinesisClient.class); if (clients.size() == 1) { diff --git a/components/camel-aws2-kinesis/src/test/java/org/apache/camel/component/aws2/firehose/KinesisFirehoseComponentConfigurationTest.java b/components/camel-aws2-kinesis/src/test/java/org/apache/camel/component/aws2/firehose/KinesisFirehoseComponentConfigurationTest.java index 6a82622..231a3f1 100644 --- a/components/camel-aws2-kinesis/src/test/java/org/apache/camel/component/aws2/firehose/KinesisFirehoseComponentConfigurationTest.java +++ b/components/camel-aws2-kinesis/src/test/java/org/apache/camel/component/aws2/firehose/KinesisFirehoseComponentConfigurationTest.java @@ -36,8 +36,8 @@ public class KinesisFirehoseComponentConfigurationTest extends CamelTestSupport @Test public void createEndpointWithComponentElements() throws Exception { KinesisFirehose2Component component = context.getComponent("aws2-kinesis-firehose", KinesisFirehose2Component.class); - component.setAccessKey("XXX"); - component.setSecretKey("YYY"); + component.getConfiguration().setAccessKey("XXX"); + component.getConfiguration().setSecretKey("YYY"); KinesisFirehose2Endpoint endpoint = (KinesisFirehose2Endpoint)component.createEndpoint("aws2-kinesis-firehose://some_stream_name"); assertEquals("some_stream_name", endpoint.getConfiguration().getStreamName()); @@ -48,9 +48,9 @@ public class KinesisFirehoseComponentConfigurationTest extends CamelTestSupport @Test public void createEndpointWithComponentAndEndpointElements() throws Exception { KinesisFirehose2Component component = context.getComponent("aws2-kinesis-firehose", KinesisFirehose2Component.class); - component.setAccessKey("XXX"); - component.setSecretKey("YYY"); - component.setRegion(Region.US_WEST_1.toString()); + component.getConfiguration().setAccessKey("XXX"); + component.getConfiguration().setSecretKey("YYY"); + component.getConfiguration().setRegion(Region.US_WEST_1.toString()); KinesisFirehose2Endpoint endpoint = (KinesisFirehose2Endpoint)component .createEndpoint("aws2-kinesis-firehose://some_stream_name?accessKey=xxxxxx&secretKey=yyyyy®ion=US_EAST_1"); @@ -63,9 +63,9 @@ public class KinesisFirehoseComponentConfigurationTest extends CamelTestSupport @Test public void createEndpointWithComponentEndpointElementsAndProxy() throws Exception { KinesisFirehose2Component component = context.getComponent("aws2-kinesis-firehose", KinesisFirehose2Component.class); - component.setAccessKey("XXX"); - component.setSecretKey("YYY"); - component.setRegion(Region.US_WEST_1.toString()); + component.getConfiguration().setAccessKey("XXX"); + component.getConfiguration().setSecretKey("YYY"); + component.getConfiguration().setRegion(Region.US_WEST_1.toString()); KinesisFirehose2Endpoint endpoint = (KinesisFirehose2Endpoint)component .createEndpoint("aws2-kinesis-firehose://label?accessKey=xxxxxx&secretKey=yyyyy®ion=US_EAST_1&proxyHost=localhost&proxyPort=9000&proxyProtocol=HTTP"); diff --git a/components/camel-aws2-kinesis/src/test/java/org/apache/camel/component/aws2/kinesis/KinesisComponentConfigurationTest.java b/components/camel-aws2-kinesis/src/test/java/org/apache/camel/component/aws2/kinesis/KinesisComponentConfigurationTest.java index aea17bb..86db5f6 100644 --- a/components/camel-aws2-kinesis/src/test/java/org/apache/camel/component/aws2/kinesis/KinesisComponentConfigurationTest.java +++ b/components/camel-aws2-kinesis/src/test/java/org/apache/camel/component/aws2/kinesis/KinesisComponentConfigurationTest.java @@ -36,8 +36,8 @@ public class KinesisComponentConfigurationTest extends CamelTestSupport { @Test public void createEndpointWithComponentElements() throws Exception { Kinesis2Component component = context.getComponent("aws2-kinesis", Kinesis2Component.class); - component.setAccessKey("XXX"); - component.setSecretKey("YYY"); + component.getConfiguration().setAccessKey("XXX"); + component.getConfiguration().setSecretKey("YYY"); Kinesis2Endpoint endpoint = (Kinesis2Endpoint)component.createEndpoint("aws2-kinesis://some_stream_name"); assertEquals("some_stream_name", endpoint.getConfiguration().getStreamName()); @@ -48,9 +48,9 @@ public class KinesisComponentConfigurationTest extends CamelTestSupport { @Test public void createEndpointWithComponentAndEndpointElements() throws Exception { Kinesis2Component component = context.getComponent("aws2-kinesis", Kinesis2Component.class); - component.setAccessKey("XXX"); - component.setSecretKey("YYY"); - component.setRegion(Region.US_WEST_1.toString()); + component.getConfiguration().setAccessKey("XXX"); + component.getConfiguration().setSecretKey("YYY"); + component.getConfiguration().setRegion(Region.US_WEST_1.toString()); Kinesis2Endpoint endpoint = (Kinesis2Endpoint)component.createEndpoint("aws2-kinesis://some_stream_name?accessKey=xxxxxx&secretKey=yyyyy®ion=US_EAST_1"); assertEquals("some_stream_name", endpoint.getConfiguration().getStreamName()); @@ -62,9 +62,9 @@ public class KinesisComponentConfigurationTest extends CamelTestSupport { @Test public void createEndpointWithComponentEndpointElementsAndProxy() throws Exception { Kinesis2Component component = context.getComponent("aws2-kinesis", Kinesis2Component.class); - component.setAccessKey("XXX"); - component.setSecretKey("YYY"); - component.setRegion(Region.US_WEST_1.toString()); + component.getConfiguration().setAccessKey("XXX"); + component.getConfiguration().setSecretKey("YYY"); + component.getConfiguration().setRegion(Region.US_WEST_1.toString()); Kinesis2Endpoint endpoint = (Kinesis2Endpoint)component .createEndpoint("aws2-kinesis://label?accessKey=xxxxxx&secretKey=yyyyy®ion=US_EAST_1&proxyHost=localhost&proxyPort=9000&proxyProtocol=HTTP"); diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2KinesisComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2KinesisComponentBuilderFactory.java index aa8ce77..6c75ceb 100644 --- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2KinesisComponentBuilderFactory.java +++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2KinesisComponentBuilderFactory.java @@ -51,28 +51,30 @@ public interface Aws2KinesisComponentBuilderFactory { extends ComponentBuilder<Kinesis2Component> { /** - * Amazon AWS Access Key. + * Amazon Kinesis client to use for all requests for this endpoint. * - * The option is a: <code>java.lang.String</code> type. + * The option is a: + * <code>software.amazon.awssdk.services.kinesis.KinesisClient</code> + * type. * * Group: common */ - default Aws2KinesisComponentBuilder accessKey(java.lang.String accessKey) { - doSetProperty("accessKey", accessKey); + default Aws2KinesisComponentBuilder amazonKinesisClient( + software.amazon.awssdk.services.kinesis.KinesisClient amazonKinesisClient) { + doSetProperty("amazonKinesisClient", amazonKinesisClient); return this; } /** - * Amazon Kinesis client to use for all requests for this endpoint. + * Component configuration. * * The option is a: - * <code>software.amazon.awssdk.services.kinesis.KinesisClient</code> - * type. + * <code>org.apache.camel.component.aws2.kinesis.Kinesis2Configuration</code> type. * * Group: common */ - default Aws2KinesisComponentBuilder amazonKinesisClient( - software.amazon.awssdk.services.kinesis.KinesisClient amazonKinesisClient) { - doSetProperty("amazonKinesisClient", amazonKinesisClient); + default Aws2KinesisComponentBuilder configuration( + org.apache.camel.component.aws2.kinesis.Kinesis2Configuration configuration) { + doSetProperty("configuration", configuration); return this; } /** @@ -127,17 +129,6 @@ public interface Aws2KinesisComponentBuilderFactory { return this; } /** - * Amazon AWS Secret Key. - * - * The option is a: <code>java.lang.String</code> type. - * - * Group: common - */ - default Aws2KinesisComponentBuilder secretKey(java.lang.String secretKey) { - doSetProperty("secretKey", secretKey); - return this; - } - /** * Allows for bridging the consumer to the Camel routing Error Handler, * which mean any exceptions occurred while the consumer is trying to * pickup incoming messages, or the likes, will now be processed as a @@ -262,16 +253,25 @@ public interface Aws2KinesisComponentBuilderFactory { return this; } /** - * The AWS S3 default configuration. + * Amazon AWS Access Key. * - * The option is a: - * <code>org.apache.camel.component.aws2.kinesis.Kinesis2Configuration</code> type. + * The option is a: <code>java.lang.String</code> type. * - * Group: advanced + * Group: security */ - default Aws2KinesisComponentBuilder configuration( - org.apache.camel.component.aws2.kinesis.Kinesis2Configuration configuration) { - doSetProperty("configuration", configuration); + default Aws2KinesisComponentBuilder 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 Aws2KinesisComponentBuilder secretKey(java.lang.String secretKey) { + doSetProperty("secretKey", secretKey); return this; } } @@ -298,13 +298,12 @@ public interface Aws2KinesisComponentBuilderFactory { String name, Object value) { switch (name) { - case "accessKey": ((Kinesis2Component) component).setAccessKey((java.lang.String) value); return true; case "amazonKinesisClient": getOrCreateConfiguration((Kinesis2Component) component).setAmazonKinesisClient((software.amazon.awssdk.services.kinesis.KinesisClient) value); return true; + case "configuration": ((Kinesis2Component) component).setConfiguration((org.apache.camel.component.aws2.kinesis.Kinesis2Configuration) value); return true; case "proxyHost": getOrCreateConfiguration((Kinesis2Component) component).setProxyHost((java.lang.String) value); return true; case "proxyPort": getOrCreateConfiguration((Kinesis2Component) component).setProxyPort((java.lang.Integer) value); return true; case "proxyProtocol": getOrCreateConfiguration((Kinesis2Component) component).setProxyProtocol((software.amazon.awssdk.core.Protocol) value); return true; case "region": getOrCreateConfiguration((Kinesis2Component) component).setRegion((java.lang.String) value); return true; - case "secretKey": ((Kinesis2Component) component).setSecretKey((java.lang.String) value); return true; case "bridgeErrorHandler": ((Kinesis2Component) component).setBridgeErrorHandler((boolean) value); return true; case "iteratorType": getOrCreateConfiguration((Kinesis2Component) component).setIteratorType((software.amazon.awssdk.services.kinesis.model.ShardIteratorType) value); return true; case "maxResultsPerRequest": getOrCreateConfiguration((Kinesis2Component) component).setMaxResultsPerRequest((int) value); return true; @@ -313,7 +312,8 @@ public interface Aws2KinesisComponentBuilderFactory { case "shardId": getOrCreateConfiguration((Kinesis2Component) component).setShardId((java.lang.String) value); return true; case "lazyStartProducer": ((Kinesis2Component) component).setLazyStartProducer((boolean) value); return true; case "basicPropertyBinding": ((Kinesis2Component) component).setBasicPropertyBinding((boolean) value); return true; - case "configuration": ((Kinesis2Component) component).setConfiguration((org.apache.camel.component.aws2.kinesis.Kinesis2Configuration) value); return true; + case "accessKey": getOrCreateConfiguration((Kinesis2Component) component).setAccessKey((java.lang.String) value); return true; + case "secretKey": getOrCreateConfiguration((Kinesis2Component) component).setSecretKey((java.lang.String) value); return true; default: return false; } } diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2KinesisFirehoseComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2KinesisFirehoseComponentBuilderFactory.java index c48e989..36ac868 100644 --- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2KinesisFirehoseComponentBuilderFactory.java +++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2KinesisFirehoseComponentBuilderFactory.java @@ -51,18 +51,6 @@ public interface Aws2KinesisFirehoseComponentBuilderFactory { extends ComponentBuilder<KinesisFirehose2Component> { /** - * Amazon AWS Access Key. - * - * The option is a: <code>java.lang.String</code> type. - * - * Group: producer - */ - default Aws2KinesisFirehoseComponentBuilder accessKey( - java.lang.String accessKey) { - doSetProperty("accessKey", accessKey); - return this; - } - /** * Amazon Kinesis Firehose client to use for all requests for this * endpoint. * @@ -78,6 +66,19 @@ public interface Aws2KinesisFirehoseComponentBuilderFactory { return this; } /** + * Component configuration. + * + * The option is a: + * <code>org.apache.camel.component.aws2.firehose.KinesisFirehose2Configuration</code> type. + * + * Group: producer + */ + default Aws2KinesisFirehoseComponentBuilder configuration( + org.apache.camel.component.aws2.firehose.KinesisFirehose2Configuration configuration) { + doSetProperty("configuration", configuration); + return this; + } + /** * 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 @@ -155,18 +156,6 @@ public interface Aws2KinesisFirehoseComponentBuilderFactory { return this; } /** - * Amazon AWS Secret Key. - * - * The option is a: <code>java.lang.String</code> type. - * - * Group: producer - */ - default Aws2KinesisFirehoseComponentBuilder secretKey( - java.lang.String secretKey) { - doSetProperty("secretKey", secretKey); - return this; - } - /** * Whether the component should use basic property binding (Camel 2.x) * or the newer property binding with additional capabilities. * @@ -181,16 +170,27 @@ public interface Aws2KinesisFirehoseComponentBuilderFactory { return this; } /** - * The AWS Kinesis Firehose default configuration. + * Amazon AWS Access Key. * - * The option is a: - * <code>org.apache.camel.component.aws2.firehose.KinesisFirehose2Configuration</code> type. + * The option is a: <code>java.lang.String</code> type. * - * Group: advanced + * Group: security */ - default Aws2KinesisFirehoseComponentBuilder configuration( - org.apache.camel.component.aws2.firehose.KinesisFirehose2Configuration configuration) { - doSetProperty("configuration", configuration); + default Aws2KinesisFirehoseComponentBuilder 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 Aws2KinesisFirehoseComponentBuilder secretKey( + java.lang.String secretKey) { + doSetProperty("secretKey", secretKey); return this; } } @@ -217,16 +217,16 @@ public interface Aws2KinesisFirehoseComponentBuilderFactory { String name, Object value) { switch (name) { - case "accessKey": ((KinesisFirehose2Component) component).setAccessKey((java.lang.String) value); return true; case "amazonKinesisFirehoseClient": getOrCreateConfiguration((KinesisFirehose2Component) component).setAmazonKinesisFirehoseClient((software.amazon.awssdk.services.firehose.FirehoseClient) value); return true; + case "configuration": ((KinesisFirehose2Component) component).setConfiguration((org.apache.camel.component.aws2.firehose.KinesisFirehose2Configuration) value); return true; case "lazyStartProducer": ((KinesisFirehose2Component) component).setLazyStartProducer((boolean) value); return true; case "proxyHost": getOrCreateConfiguration((KinesisFirehose2Component) component).setProxyHost((java.lang.String) value); return true; case "proxyPort": getOrCreateConfiguration((KinesisFirehose2Component) component).setProxyPort((java.lang.Integer) value); return true; case "proxyProtocol": getOrCreateConfiguration((KinesisFirehose2Component) component).setProxyProtocol((software.amazon.awssdk.core.Protocol) value); return true; case "region": getOrCreateConfiguration((KinesisFirehose2Component) component).setRegion((java.lang.String) value); return true; - case "secretKey": ((KinesisFirehose2Component) component).setSecretKey((java.lang.String) value); return true; case "basicPropertyBinding": ((KinesisFirehose2Component) component).setBasicPropertyBinding((boolean) value); return true; - case "configuration": ((KinesisFirehose2Component) component).setConfiguration((org.apache.camel.component.aws2.firehose.KinesisFirehose2Configuration) value); return true; + case "accessKey": getOrCreateConfiguration((KinesisFirehose2Component) component).setAccessKey((java.lang.String) value); return true; + case "secretKey": getOrCreateConfiguration((KinesisFirehose2Component) component).setSecretKey((java.lang.String) value); return true; default: return false; } }