This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 89f3dd46d0a49ba88e312c647fbcdc417de7657c Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Mon Dec 20 18:16:30 2021 +0100 CAMEL-15951 - Introduce configuration property to skip DescribeTable operation on start of aws2-ddb component --- .../aws2/ddb/Ddb2ComponentConfigurer.java | 6 ++++ .../component/aws2/ddb/Ddb2EndpointConfigurer.java | 6 ++++ .../component/aws2/ddb/Ddb2EndpointUriFactory.java | 3 +- .../apache/camel/component/aws2/ddb/aws2-ddb.json | 2 ++ .../component/aws2/ddb/Ddb2Configuration.java | 2 +- .../dsl/Aws2DdbComponentBuilderFactory.java | 18 +++++++++++ .../endpoint/dsl/Ddb2EndpointBuilderFactory.java | 35 ++++++++++++++++++++++ 7 files changed, 70 insertions(+), 2 deletions(-) diff --git a/components/camel-aws/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2ComponentConfigurer.java b/components/camel-aws/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2ComponentConfigurer.java index b1215ce..7ec1721 100644 --- a/components/camel-aws/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2ComponentConfigurer.java +++ b/components/camel-aws/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2ComponentConfigurer.java @@ -37,6 +37,8 @@ public class Ddb2ComponentConfigurer extends PropertyConfigurerSupport implement case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws2.ddb.Ddb2Configuration.class, value)); return true; case "consistentread": case "consistentRead": getOrCreateConfiguration(target).setConsistentRead(property(camelContext, boolean.class, value)); return true; + case "enabledinitialdescribetable": + case "enabledInitialDescribeTable": getOrCreateConfiguration(target).setEnabledInitialDescribeTable(property(camelContext, boolean.class, value)); return true; case "keyattributename": case "keyAttributeName": getOrCreateConfiguration(target).setKeyAttributeName(property(camelContext, java.lang.String.class, value)); return true; case "keyattributetype": @@ -88,6 +90,8 @@ public class Ddb2ComponentConfigurer extends PropertyConfigurerSupport implement case "configuration": return org.apache.camel.component.aws2.ddb.Ddb2Configuration.class; case "consistentread": case "consistentRead": return boolean.class; + case "enabledinitialdescribetable": + case "enabledInitialDescribeTable": return boolean.class; case "keyattributename": case "keyAttributeName": return java.lang.String.class; case "keyattributetype": @@ -135,6 +139,8 @@ public class Ddb2ComponentConfigurer extends PropertyConfigurerSupport implement case "configuration": return target.getConfiguration(); case "consistentread": case "consistentRead": return getOrCreateConfiguration(target).isConsistentRead(); + case "enabledinitialdescribetable": + case "enabledInitialDescribeTable": return getOrCreateConfiguration(target).isEnabledInitialDescribeTable(); case "keyattributename": case "keyAttributeName": return getOrCreateConfiguration(target).getKeyAttributeName(); case "keyattributetype": diff --git a/components/camel-aws/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointConfigurer.java b/components/camel-aws/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointConfigurer.java index ee60c1b..933505b 100644 --- a/components/camel-aws/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointConfigurer.java +++ b/components/camel-aws/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointConfigurer.java @@ -27,6 +27,8 @@ public class Ddb2EndpointConfigurer extends PropertyConfigurerSupport implements case "amazonDDBClient": target.getConfiguration().setAmazonDDBClient(property(camelContext, software.amazon.awssdk.services.dynamodb.DynamoDbClient.class, value)); return true; case "consistentread": case "consistentRead": target.getConfiguration().setConsistentRead(property(camelContext, boolean.class, value)); return true; + case "enabledinitialdescribetable": + case "enabledInitialDescribeTable": target.getConfiguration().setEnabledInitialDescribeTable(property(camelContext, boolean.class, value)); return true; case "keyattributename": case "keyAttributeName": target.getConfiguration().setKeyAttributeName(property(camelContext, java.lang.String.class, value)); return true; case "keyattributetype": @@ -75,6 +77,8 @@ public class Ddb2EndpointConfigurer extends PropertyConfigurerSupport implements case "amazonDDBClient": return software.amazon.awssdk.services.dynamodb.DynamoDbClient.class; case "consistentread": case "consistentRead": return boolean.class; + case "enabledinitialdescribetable": + case "enabledInitialDescribeTable": return boolean.class; case "keyattributename": case "keyAttributeName": return java.lang.String.class; case "keyattributetype": @@ -119,6 +123,8 @@ public class Ddb2EndpointConfigurer extends PropertyConfigurerSupport implements case "amazonDDBClient": return target.getConfiguration().getAmazonDDBClient(); case "consistentread": case "consistentRead": return target.getConfiguration().isConsistentRead(); + case "enabledinitialdescribetable": + case "enabledInitialDescribeTable": return target.getConfiguration().isEnabledInitialDescribeTable(); case "keyattributename": case "keyAttributeName": return target.getConfiguration().getKeyAttributeName(); case "keyattributetype": diff --git a/components/camel-aws/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointUriFactory.java b/components/camel-aws/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointUriFactory.java index 63dc75a..27da2ef 100644 --- a/components/camel-aws/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointUriFactory.java +++ b/components/camel-aws/camel-aws2-ddb/src/generated/java/org/apache/camel/component/aws2/ddb/Ddb2EndpointUriFactory.java @@ -20,13 +20,14 @@ public class Ddb2EndpointUriFactory extends org.apache.camel.support.component.E private static final Set<String> PROPERTY_NAMES; private static final Set<String> SECRET_PROPERTY_NAMES; static { - Set<String> props = new HashSet<>(20); + Set<String> props = new HashSet<>(21); props.add("amazonDDBClient"); props.add("proxyProtocol"); props.add("readCapacity"); props.add("secretKey"); props.add("keyScalarType"); props.add("uriEndpointOverride"); + props.add("enabledInitialDescribeTable"); props.add("keyAttributeType"); props.add("useDefaultCredentialsProvider"); props.add("proxyHost"); diff --git a/components/camel-aws/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json b/components/camel-aws/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json index 1480ea2..52075fd 100644 --- a/components/camel-aws/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json +++ b/components/camel-aws/camel-aws2-ddb/src/generated/resources/org/apache/camel/component/aws2/ddb/aws2-ddb.json @@ -25,6 +25,7 @@ "amazonDDBClient": { "kind": "property", "displayName": "Amazon DDBClient", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.DynamoDbClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "To use the AmazonDynamoDB as the client" }, "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "The component configuration" }, "consistentRead": { "kind": "property", "displayName": "Consistent Read", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Determines whether or not strong consistency should be enforced when data is read." }, + "enabledInitialDescribeTable": { "kind": "property", "displayName": "Enabled Initial Describe Table", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Set whether the initial Describe table operation in the DDB Endpoint must be [...] "keyAttributeName": { "kind": "property", "displayName": "Key Attribute Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Attribute name when creating table" }, "keyAttributeType": { "kind": "property", "displayName": "Key Attribute Type", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Attribute type when creating table" }, "keyScalarType": { "kind": "property", "displayName": "Key Scalar Type", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "The key scalar type, it can be S (String), N (Number) and B (Bytes)" }, @@ -48,6 +49,7 @@ "tableName": { "kind": "path", "displayName": "Table Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "The name of the table currently worked with." }, "amazonDDBClient": { "kind": "parameter", "displayName": "Amazon DDBClient", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.dynamodb.DynamoDbClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "To use the AmazonDynamoDB as the client" }, "consistentRead": { "kind": "parameter", "displayName": "Consistent Read", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Determines whether or not strong consistency should be enforced when data is read." }, + "enabledInitialDescribeTable": { "kind": "parameter", "displayName": "Enabled Initial Describe Table", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Set whether the initial Describe table operation in the DDB Endpoint must be [...] "keyAttributeName": { "kind": "parameter", "displayName": "Key Attribute Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Attribute name when creating table" }, "keyAttributeType": { "kind": "parameter", "displayName": "Key Attribute Type", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "Attribute type when creating table" }, "keyScalarType": { "kind": "parameter", "displayName": "Key Scalar Type", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.ddb.Ddb2Configuration", "configurationField": "configuration", "description": "The key scalar type, it can be S (String), N (Number) and B (Bytes)" }, diff --git a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Configuration.java b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Configuration.java index 3d81fcf..5086cf9 100644 --- a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Configuration.java +++ b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddb/Ddb2Configuration.java @@ -68,7 +68,7 @@ public class Ddb2Configuration implements Cloneable { @UriParam(defaultValue = "false") private boolean useDefaultCredentialsProvider; @UriParam(defaultValue = "true") - private boolean enabledInitialDescribeTable; + private boolean enabledInitialDescribeTable = true; public String getAccessKey() { return accessKey; diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbComponentBuilderFactory.java index 4f75817..7e6e988 100644 --- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbComponentBuilderFactory.java +++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2DdbComponentBuilderFactory.java @@ -98,6 +98,23 @@ public interface Aws2DdbComponentBuilderFactory { return this; } /** + * Set whether the initial Describe table operation in the DDB Endpoint + * must be done, or not. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: producer + * + * @param enabledInitialDescribeTable the value to set + * @return the dsl builder + */ + default Aws2DdbComponentBuilder enabledInitialDescribeTable( + boolean enabledInitialDescribeTable) { + doSetProperty("enabledInitialDescribeTable", enabledInitialDescribeTable); + return this; + } + /** * Attribute name when creating table. * * The option is a: <code>java.lang.String</code> type. @@ -420,6 +437,7 @@ public interface Aws2DdbComponentBuilderFactory { case "amazonDDBClient": getOrCreateConfiguration((Ddb2Component) component).setAmazonDDBClient((software.amazon.awssdk.services.dynamodb.DynamoDbClient) value); return true; case "configuration": ((Ddb2Component) component).setConfiguration((org.apache.camel.component.aws2.ddb.Ddb2Configuration) value); return true; case "consistentRead": getOrCreateConfiguration((Ddb2Component) component).setConsistentRead((boolean) value); return true; + case "enabledInitialDescribeTable": getOrCreateConfiguration((Ddb2Component) component).setEnabledInitialDescribeTable((boolean) value); return true; case "keyAttributeName": getOrCreateConfiguration((Ddb2Component) component).setKeyAttributeName((java.lang.String) value); return true; case "keyAttributeType": getOrCreateConfiguration((Ddb2Component) component).setKeyAttributeType((java.lang.String) value); return true; case "keyScalarType": getOrCreateConfiguration((Ddb2Component) component).setKeyScalarType((java.lang.String) value); return true; diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2EndpointBuilderFactory.java index 7696f01..983d2d4 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2EndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Ddb2EndpointBuilderFactory.java @@ -98,6 +98,41 @@ public interface Ddb2EndpointBuilderFactory { return this; } /** + * Set whether the initial Describe table operation in the DDB Endpoint + * must be done, or not. + * + * The option is a: <code>boolean</code> type. + * + * Default: true + * Group: producer + * + * @param enabledInitialDescribeTable the value to set + * @return the dsl builder + */ + default Ddb2EndpointBuilder enabledInitialDescribeTable( + boolean enabledInitialDescribeTable) { + doSetProperty("enabledInitialDescribeTable", enabledInitialDescribeTable); + return this; + } + /** + * Set whether the initial Describe table operation in the DDB Endpoint + * must be done, or not. + * + * The option will be converted to a <code>boolean</code> + * type. + * + * Default: true + * Group: producer + * + * @param enabledInitialDescribeTable the value to set + * @return the dsl builder + */ + default Ddb2EndpointBuilder enabledInitialDescribeTable( + String enabledInitialDescribeTable) { + doSetProperty("enabledInitialDescribeTable", enabledInitialDescribeTable); + return this; + } + /** * Attribute name when creating table. * * The option is a: <code>java.lang.String</code> type.