Thanks to visit codestin.com
Credit goes to github.com

Skip to content

v2.2.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 15 Jul 10:43
· 1 commit to refs/heads/main since this release

Summary

This release adds GraalVM support to the Serialization utility and improves the Batch Processing utility allowing you to pass a custom Executor giving you more control over the resources used by the batch operations.

⭐️ Thanks to @visheshruparelia for their first contribution to Powertools for AWS! And thanks to @jreijn for adding GraalVM support to the serialization module.

Add support for batch execution in parallel with custom Executor

Docs

This feature enhances the batch processing capabilities by allowing parallel execution with a custom Executor. This allows you to customize the resources used by the batch operations, such as providing your own thread pool giving you more control over the degree of concurrency.

Here's an example of how to use a custom executor for parallel batch processing:

public class SqsBatchHandler implements RequestHandler<SQSEvent, SQSBatchResponse> {

 private final BatchMessageHandler<SQSEvent, SQSBatchResponse> handler;
 private final ExecutorService executor;
    
 public SqsBatchHandler() {
    handler = new BatchMessageHandlerBuilder()
                    .withSqsBatchHandler()
                    .buildWithMessageHandler(this::processMessage, Product.class);
                    executor = Executors.newFixedThreadPool(2);
 }
    
 @Override
 public SQSBatchResponse handleRequest(SQSEvent sqsEvent, Context context) {
    // New feature: custom executor can now be passed as a method argument for parallel processing
    return handler.processBatchInParallel(sqsEvent, context, executor);
 }
    
 private void processMessage(Product p, Context c) {
    // Process the product
 }
}

Changes

  • chore(ci): bump version to 2.2.0 (#1942) by @github-actions[bot]
  • build(deps): bump org.codehaus.mojo:build-helper-maven-plugin from 3.6.0 to 3.6.1 (#1941) by @dependabot[bot]
  • build(deps): bump org.sonatype.central:central-publishing-maven-plugin from 0.7.0 to 0.8.0 (#1940) by @dependabot[bot]
  • build(deps): bump log4j.version from 2.24.3 to 2.25.1 (#1939) by @dependabot[bot]
  • build(deps): bump aws.sdk.version from 2.30.31 to 2.31.78 (#1938) by @dependabot[bot]
  • build(deps-dev): bump org.apache.commons:commons-lang3 from 3.15.0 to 3.18.0 in /powertools-parameters/powertools-parameters-dynamodb (#1937) by @dependabot[bot]
  • build(deps): bump org.apache.commons:commons-lang3 from 3.15.0 to 3.18.0 (#1936) by @dependabot[bot]
  • feat: add support for batch execution in parallel with custom Executor (#1900) by @visheshruparelia
  • fix(examples): Fix GraalVM metadata after common runtime client changes (#1935) by @jreijn
  • feat(serialization): Add GraalVM metadata configuration (#1905) by @jreijn
  • build(deps): Upgrade logback to 1.5.18 (#1933) by @phipag
  • build(deps): Upgrade DynamoDBLocal to 2.6.0 (#1931) by @phipag
  • build(deps): bump jackson.version from 2.17.2 to 2.19.1 (#1928) by @dependabot[bot]
  • build(deps-dev): bump com.amazonaws:amazon-sqs-java-extended-client-lib from 2.1.0 to 2.1.2 (#1929) by @dependabot[bot]
  • build(deps): bump com.amazonaws:aws-lambda-java-runtime-interface-client from 2.1.1 to 2.8.2 (#1927) by @dependabot[bot]
  • build(deps): bump org.assertj:assertj-core from 3.26.3 to 3.27.3 (#1926) by @dependabot[bot]
  • build(deps): bump aws.sdk.version from 2.31.62 to 2.31.78 (#1925) by @dependabot[bot]
  • chore(ci): Remove v2 dependabot configuration. Restore OSSF scorecard workflow. (#1924) by @phipag
  • build(deps): Move wiremock to new version with patched CVEs. (#1923) by @phipag
  • build(deps): bump com.amazonaws:aws-lambda-java-events from 3.15.0 to 3.16.0 (#1913) by @dependabot[bot]
  • build(deps): bump log4j.version from 2.24.0 to 2.24.3 (#1893) by @dependabot[bot]
  • build(deps): bump com.amazonaws:aws-lambda-java-core from 1.2.3 to 1.3.0 (#1892) by @dependabot[bot]
  • build(deps): bump org.junit-pioneer:junit-pioneer from 1.9.1 to 2.0.0 (#1884) by @dependabot[bot]
  • build(deps): bump org.junit.jupiter:junit-jupiter-engine from 5.9.3 to 5.13.1 (#1865) by @dependabot[bot]
  • build(deps): bump org.apache.logging.log4j:log4j-transform-maven-shade-plugin-extensions from 0.1.0 to 0.2.0 (#1853) by @dependabot[bot]
  • build(deps): bump commons-io:commons-io from 2.16.1 to 2.19.0 (#1852) by @dependabot[bot]
  • build(deps): bump aws.sdk.version from 2.31.40 to 2.31.62 (#1886) by @dependabot[bot]
  • build(deps): bump org.jacoco:jacoco-maven-plugin from 0.8.12 to 0.8.13 (#1849) by @dependabot[bot]
  • chore: update issue, PR, and discussion templates (#1915) by @dreamorosi
  • chore(ci): Update branch protection rules (#1914) by @sthulb
  • chore(ci): bump version to 2.1.1 (#1910) by @github-actions[bot]

This release was made possible by the following contributors:

@dreamorosi, @jreijn, @phipag, @sthulb, @visheshruparelia