Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15951

Introduce configuration property to skip DescribeTable operation on start of aws2-ddb component

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.6.0
    • 3.14.2, 3.15.0
    • camel-aws2
    • None
    • Unknown

    Description

      On aws2-ddb endpoint start it constantly checking table status by doing DescribeTable request.

       @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);
              }
          }
      

      Key issues with such approach:

      Potential Solution:

      • introduce createTable configuration parameter and use DescribeTable only if createTable==true (default false)

      Attachments

        Activity

          People

            acosentino Andrea Cosentino
            cynicLT Kiril Nugmanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: