PromucFlow_constructor/app/server/appsmith-plugins/dynamoPlugin/pom.xml

79 lines
2.7 KiB
XML
Raw Normal View History

Add DynamoDB Plugin (#1167) * Added DynamoPlugin to integrate with DynamoDB * Connection management for DynamoPlugin * Process action from a single JSON object as input * Moved ListTables command to separate class * Add missing UI definition files * Use reflection to build request objects for AWS SDK * All DynamoDB actions are now run purely by reflection * Serialize responses to JSON * Remove some unused/commented code and some refactorings * Add non-working test with generic dynamodb container * Added working test for ListTables action * Added test for PutItem action * Add tests for get and update actions * Added comments and some refactoring * Removed unused Command class. * Added more tests for map to SDK object conversion * Add templates * Add option to set an endpoint override * Fix Dynamo plugin tests when ~/.aws is missing * Add documentation link for DynamoDB plugin * Fix validation checks * Remove debug log * Added comments on expected query structure * Fix incorrect error condition with incorrect request format * Add comment for converting action to method name * Error out if region is missing * Remove unused throws declaration * Use rich form for action configuration * Removed templates * Use PNG for logo images * Use PNG logos for all plugins * Avoid hard-coded field names * Change logo to PNG only for ElasticSearch for now * Wrap errors in AppsmithPluginException * Typo Co-authored-by: Trisha Anand <trisha@appsmith.com> * Fix changeset order number Co-authored-by: Trisha Anand <trisha@appsmith.com> * Minor refactoring and fixed error messaging Co-authored-by: Trisha Anand <trisha@appsmith.com>
2020-10-21 12:15:54 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.appsmith</groupId>
<artifactId>appsmith-plugins</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
Add DynamoDB Plugin (#1167) * Added DynamoPlugin to integrate with DynamoDB * Connection management for DynamoPlugin * Process action from a single JSON object as input * Moved ListTables command to separate class * Add missing UI definition files * Use reflection to build request objects for AWS SDK * All DynamoDB actions are now run purely by reflection * Serialize responses to JSON * Remove some unused/commented code and some refactorings * Add non-working test with generic dynamodb container * Added working test for ListTables action * Added test for PutItem action * Add tests for get and update actions * Added comments and some refactoring * Removed unused Command class. * Added more tests for map to SDK object conversion * Add templates * Add option to set an endpoint override * Fix Dynamo plugin tests when ~/.aws is missing * Add documentation link for DynamoDB plugin * Fix validation checks * Remove debug log * Added comments on expected query structure * Fix incorrect error condition with incorrect request format * Add comment for converting action to method name * Error out if region is missing * Remove unused throws declaration * Use rich form for action configuration * Removed templates * Use PNG for logo images * Use PNG logos for all plugins * Avoid hard-coded field names * Change logo to PNG only for ElasticSearch for now * Wrap errors in AppsmithPluginException * Typo Co-authored-by: Trisha Anand <trisha@appsmith.com> * Fix changeset order number Co-authored-by: Trisha Anand <trisha@appsmith.com> * Minor refactoring and fixed error messaging Co-authored-by: Trisha Anand <trisha@appsmith.com>
2020-10-21 12:15:54 +00:00
<groupId>com.external.plugins</groupId>
<artifactId>dynamoPlugin</artifactId>
<version>1.0-SNAPSHOT</version>
<name>dynamoPlugin</name>
<dependencies>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>dynamodb</artifactId>
<version>2.15.3</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
fix: connection pool config added for dynamoDB to avoid stale connections (#38940) ## Description **Problem statement:** In one of the instances where dynamoDB had close to 200 odd queries on top of it, queries were timing out after a month or so, this happened 3 times with one of the users, where after a month, queries would suddenly start timing out. One of the hunches was that since we create dynamoDBclient object only once during datasource creation, it could be getting stale thus resulting in query timeouts and with that hunch, we decided to add a fix where we close the old connections regularly after using for a day. **Solution:** This PR configures connection time to live property for DynamoDB plugin. This is configured to be 1 day which means after 1 day, active/idle connections will be closed. This is done to ensure that we don't face issues if the connection becomes stale. Default value of connection time to live is 0 which means the connection stays open for infinite amount of time. To ensure that we do not cause any issues due to introduction of this property, we decided to add this behind a feature flag. All the feature flagging related code exists at the `appsmith-server` module but dynamoDb code exists in `appsmith-plugins -> dynamoDB` module, so in order to provide feature flagging, ideally we should make feature flagging service available at `appsmith-interface` module to ensure that it can get consumed across different modules but that's a [known tech debt](https://github.com/appsmithorg/appsmith/issues/39425) which we should resolve soon, but in the meantime to expedite the fix, I have passed in flag details to respective datasourceCreate functionality. datasourceCreate also gets called from testDatasource, so feature flagging has been implemented there as well. At some point in time, based on whether this potential fix works or not, we should plan to remove the feature flagging code, task for that added [here](https://github.com/appsmithorg/appsmith/issues/39426) **References:** - https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/apache/ApacheHttpClient.Builder.html#connectionTimeToLive(java.time.Duration) - https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/SdkHttpConfigurationOption.html#CONNECTION_TIME_TO_LIVE - https://github.com/aws/aws-sdk-java/issues/2788 Fixes #[`Issue Number`](https://github.com/appsmithorg/appsmith-ee/issues/6030) _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.Datasource" ### :mag: Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/13515219987> > Commit: 953e570b2e153087fa7b27c8c24cb50f74333159 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13515219987&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource` > Spec: > <hr>Tue, 25 Feb 2025 07:21:25 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced DynamoDB plugin connection management with configurable connection time-to-live - Added Apache HTTP client support for improved network connection handling - **Dependencies** - Updated Apache client dependency to version 2.15.3 <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: “sneha122” <“sneha@appsmith.com”>
2025-02-25 16:33:11 +00:00
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>apache-client</artifactId>
<version>2.15.3</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
Add DynamoDB Plugin (#1167) * Added DynamoPlugin to integrate with DynamoDB * Connection management for DynamoPlugin * Process action from a single JSON object as input * Moved ListTables command to separate class * Add missing UI definition files * Use reflection to build request objects for AWS SDK * All DynamoDB actions are now run purely by reflection * Serialize responses to JSON * Remove some unused/commented code and some refactorings * Add non-working test with generic dynamodb container * Added working test for ListTables action * Added test for PutItem action * Add tests for get and update actions * Added comments and some refactoring * Removed unused Command class. * Added more tests for map to SDK object conversion * Add templates * Add option to set an endpoint override * Fix Dynamo plugin tests when ~/.aws is missing * Add documentation link for DynamoDB plugin * Fix validation checks * Remove debug log * Added comments on expected query structure * Fix incorrect error condition with incorrect request format * Add comment for converting action to method name * Error out if region is missing * Remove unused throws declaration * Use rich form for action configuration * Removed templates * Use PNG for logo images * Use PNG logos for all plugins * Avoid hard-coded field names * Change logo to PNG only for ElasticSearch for now * Wrap errors in AppsmithPluginException * Typo Co-authored-by: Trisha Anand <trisha@appsmith.com> * Fix changeset order number Co-authored-by: Trisha Anand <trisha@appsmith.com> * Minor refactoring and fixed error messaging Co-authored-by: Trisha Anand <trisha@appsmith.com>
2020-10-21 12:15:54 +00:00
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<goals>
<goal>copy-dependencies</goal>
</goals>
<phase>package</phase>
Add DynamoDB Plugin (#1167) * Added DynamoPlugin to integrate with DynamoDB * Connection management for DynamoPlugin * Process action from a single JSON object as input * Moved ListTables command to separate class * Add missing UI definition files * Use reflection to build request objects for AWS SDK * All DynamoDB actions are now run purely by reflection * Serialize responses to JSON * Remove some unused/commented code and some refactorings * Add non-working test with generic dynamodb container * Added working test for ListTables action * Added test for PutItem action * Add tests for get and update actions * Added comments and some refactoring * Removed unused Command class. * Added more tests for map to SDK object conversion * Add templates * Add option to set an endpoint override * Fix Dynamo plugin tests when ~/.aws is missing * Add documentation link for DynamoDB plugin * Fix validation checks * Remove debug log * Added comments on expected query structure * Fix incorrect error condition with incorrect request format * Add comment for converting action to method name * Error out if region is missing * Remove unused throws declaration * Use rich form for action configuration * Removed templates * Use PNG for logo images * Use PNG logos for all plugins * Avoid hard-coded field names * Change logo to PNG only for ElasticSearch for now * Wrap errors in AppsmithPluginException * Typo Co-authored-by: Trisha Anand <trisha@appsmith.com> * Fix changeset order number Co-authored-by: Trisha Anand <trisha@appsmith.com> * Minor refactoring and fixed error messaging Co-authored-by: Trisha Anand <trisha@appsmith.com>
2020-10-21 12:15:54 +00:00
<configuration>
<includeScope>runtime</includeScope>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>