You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Andrea Cosentino (Jira)" <ji...@apache.org> on 2021/12/10 17:41:00 UTC
[jira] [Updated] (CAMEL-15951) Introduce configuration property to skip DescribeTable operation on start of aws2-ddb component
[ https://issues.apache.org/jira/browse/CAMEL-15951?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrea Cosentino updated CAMEL-15951:
-------------------------------------
Fix Version/s: 3.15.0
> Introduce configuration property to skip DescribeTable operation on start of aws2-ddb component
> ------------------------------------------------------------------------------------------------
>
> Key: CAMEL-15951
> URL: https://issues.apache.org/jira/browse/CAMEL-15951
> Project: Camel
> Issue Type: New Feature
> Components: camel-aws2
> Affects Versions: 3.6.0
> Reporter: Kiril Nugmanov
> Assignee: Andrea Cosentino
> Priority: Major
> Fix For: 3.15.0
>
>
> On {{aws2-ddb}} endpoint start it constantly checking table status by doing {{DescribeTable}} request.
> {code:java}
> @Override
> public void doStart() throws Exception {
> super.doStart();
> ddbClient = configuration.getAmazonDDBClient() != null ? configuration.getAmazonDDBClient() : createDdbClient();
> String tableName = getConfiguration().getTableName();
> LOG.trace("Querying whether table [{}] already exists...", tableName);
> try {
> DescribeTableRequest.Builder request = DescribeTableRequest.builder().tableName(tableName);
> TableDescription tableDescription = ddbClient.describeTable(request.build()).table();
> if (!isTableActive(tableDescription)) {
> waitForTableToBecomeAvailable(tableName);
> }
> LOG.trace("Table [{}] already exists", tableName);
> return;
> } catch (ResourceNotFoundException e) {
> LOG.trace("Table [{}] doesn't exist yet", tableName);
> LOG.trace("Creating table [{}]...", tableName);
> TableDescription tableDescription = createTable(tableName);
> if (!isTableActive(tableDescription)) {
> waitForTableToBecomeAvailable(tableName);
> }
> LOG.trace("Table [{}] created", tableName);
> }
> }
> {code}
> Key issues with such approach:
> * it requires to grant {{DescribeTable}} operation for client which provides sensitive information like KMS master key ARN/ID, billing information etc. ([https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTable.html])
> * after start and checking table status for being ACTIVE there is no guarantee that it's actually true on doing any other DDB operation with started component.
> Potential Solution:
> * introduce {{createTable}} configuration parameter and use {{DescribeTable}} only if {{createTable}}=={{true}} (default {{false}})
--
This message was sent by Atlassian Jira
(v8.20.1#820001)