diff --git a/.github/workflows/ci-snapshot.yml b/.github/workflows/ci-snapshot.yml index fce6a9c..ebd5896 100644 --- a/.github/workflows/ci-snapshot.yml +++ b/.github/workflows/ci-snapshot.yml @@ -13,6 +13,6 @@ jobs: with: gradleTasks: dist secrets: - GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e188002..6be0111 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: buildToolArgs: dist secrets: GH_ACTIONS_REPO_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }} - GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }} + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} diff --git a/build.gradle b/build.gradle index 8f2194f..c3a76de 100644 --- a/build.gradle +++ b/build.gradle @@ -27,17 +27,17 @@ repositories { ext { assertjVersion = '3.26.3' - awaitilityVersion = '4.2.1' + awaitilityVersion = '4.2.2' awsSdkVersion = '2.20.162' jacksonVersion = '2.15.4' - junitVersion = '5.10.3' - log4jVersion = '2.23.1' + junitVersion = '5.11.0' + log4jVersion = '2.24.0' servletApiVersion = '6.0.0' - springCloudAwsVersion = '3.0.4' + springCloudAwsVersion = '3.0.5' springIntegrationVersion = '6.0.9' kinesisClientVersion = '2.5.8' - kinesisProducerVersion = '0.15.10' - testcontainersVersion = '1.19.8' + kinesisProducerVersion = '0.15.11' + testcontainersVersion = '1.20.1' idPrefix = 'aws' @@ -102,7 +102,7 @@ dependencyManagement { checkstyle { configDirectory.set(rootProject.file('src/checkstyle')) - toolVersion = '10.12.4' + toolVersion = '10.18.1' } dependencies { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 2c35211..a4b76b9 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 68e8816..8e876e1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab -distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip +distributionSha256Sum=1541fa36599e12857140465f3c91a97409b4512501c26f9631fb113e392c5bd1 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/publish-maven.gradle b/publish-maven.gradle index 5ef1422..44a6019 100644 --- a/publish-maven.gradle +++ b/publish-maven.gradle @@ -33,7 +33,7 @@ publishing { developer { id = 'artembilan' name = 'Artem Bilan' - email = 'abilan@vmware.com' + email = 'artem.bilan@broadcom.com' roles = ['project lead'] } } diff --git a/settings.gradle b/settings.gradle index bde98ca..fa7cd68 100644 --- a/settings.gradle +++ b/settings.gradle @@ -6,8 +6,7 @@ pluginManagement { } plugins { - id 'com.gradle.develocity' version '3.17.5' - id 'io.spring.develocity.conventions' version '0.0.19' + id 'io.spring.develocity.conventions' version '0.0.21' } rootProject.name = 'spring-integration-aws' diff --git a/src/main/java/org/springframework/integration/aws/inbound/SnsInboundChannelAdapter.java b/src/main/java/org/springframework/integration/aws/inbound/SnsInboundChannelAdapter.java index 5cf20c3..f76de8a 100644 --- a/src/main/java/org/springframework/integration/aws/inbound/SnsInboundChannelAdapter.java +++ b/src/main/java/org/springframework/integration/aws/inbound/SnsInboundChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,6 +80,8 @@ public class SnsInboundChannelAdapter extends HttpRequestHandlingMessagingGatewa private final MappingJackson2HttpMessageConverter jackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter(); + private final String[] path; + private volatile boolean handleNotificationStatus; private volatile Expression payloadExpression; @@ -91,17 +93,10 @@ public class SnsInboundChannelAdapter extends HttpRequestHandlingMessagingGatewa Assert.notNull(amazonSns, "'amazonSns' must not be null."); Assert.notNull(path, "'path' must not be null."); Assert.noNullElements(path, "'path' must not contain null elements."); + this.path = path; this.notificationStatusResolver = new NotificationStatusResolver(amazonSns); - RequestMapping requestMapping = new RequestMapping(); - requestMapping.setMethods(HttpMethod.POST); - requestMapping.setHeaders("x-amz-sns-message-type"); - requestMapping.setPathPatterns(path); this.jackson2HttpMessageConverter .setSupportedMediaTypes(Arrays.asList(MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN)); - super.setRequestMapping(requestMapping); - super.setStatusCodeExpression(new ValueExpression<>(HttpStatus.NO_CONTENT)); - super.setMessageConverters(Collections.singletonList(this.jackson2HttpMessageConverter)); - super.setRequestPayloadTypeClass(HashMap.class); } public void setHandleNotificationStatus(boolean handleNotificationStatus) { @@ -111,6 +106,14 @@ public class SnsInboundChannelAdapter extends HttpRequestHandlingMessagingGatewa @Override protected void onInit() { super.onInit(); + RequestMapping requestMapping = new RequestMapping(); + requestMapping.setMethods(HttpMethod.POST); + requestMapping.setHeaders("x-amz-sns-message-type"); + requestMapping.setPathPatterns(this.path); + super.setStatusCodeExpression(new ValueExpression<>(HttpStatus.NO_CONTENT)); + super.setMessageConverters(Collections.singletonList(this.jackson2HttpMessageConverter)); + super.setRequestPayloadTypeClass(HashMap.class); + super.setRequestMapping(requestMapping); if (this.payloadExpression != null) { this.evaluationContext = createEvaluationContext(); } diff --git a/src/main/java/org/springframework/integration/aws/inbound/kinesis/KinesisMessageDrivenChannelAdapter.java b/src/main/java/org/springframework/integration/aws/inbound/kinesis/KinesisMessageDrivenChannelAdapter.java index 2f111ea..473637d 100644 --- a/src/main/java/org/springframework/integration/aws/inbound/kinesis/KinesisMessageDrivenChannelAdapter.java +++ b/src/main/java/org/springframework/integration/aws/inbound/kinesis/KinesisMessageDrivenChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -125,8 +125,14 @@ public class KinesisMessageDrivenChannelAdapter extends MessageProducerSupport private final ExecutorService shardLocksExecutor = Executors.newSingleThreadExecutor( - new CustomizableThreadFactory( - (getComponentName() == null ? "" : getComponentName()) + "-kinesis-shard-locks-")); + new CustomizableThreadFactory() { + + @Override + protected String getDefaultThreadNamePrefix() { + return (getComponentName() == null ? "" : getComponentName()) + "-kinesis-shard-locks-"; + } + + }); private String consumerGroup = "SpringIntegration"; diff --git a/src/main/java/org/springframework/integration/aws/outbound/AbstractAwsMessageHandler.java b/src/main/java/org/springframework/integration/aws/outbound/AbstractAwsMessageHandler.java index 394c17a..882adc5 100644 --- a/src/main/java/org/springframework/integration/aws/outbound/AbstractAwsMessageHandler.java +++ b/src/main/java/org/springframework/integration/aws/outbound/AbstractAwsMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2023 the original author or authors. + * Copyright 2017-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,10 +83,16 @@ public abstract class AbstractAwsMessageHandler extends AbstractMessageProduc * @param headerMapper the {@link HeaderMapper} to map outbound headers. */ public void setHeaderMapper(HeaderMapper headerMapper) { - doSetHeaderMapper(headerMapper); + this.headerMapper = headerMapper; } - protected final void doSetHeaderMapper(HeaderMapper headerMapper) { + /** + * Set a {@link HeaderMapper} to use. + * @param headerMapper the header mapper to set + * @deprecated in favor of {@link #setHeaderMapper(HeaderMapper)} to be called from {@link #onInit()}. + */ + @Deprecated(forRemoval = true, since = "3.0.8") + protected void doSetHeaderMapper(HeaderMapper headerMapper) { this.headerMapper = headerMapper; } diff --git a/src/main/java/org/springframework/integration/aws/outbound/SnsMessageHandler.java b/src/main/java/org/springframework/integration/aws/outbound/SnsMessageHandler.java index 0a3b005..7b09866 100644 --- a/src/main/java/org/springframework/integration/aws/outbound/SnsMessageHandler.java +++ b/src/main/java/org/springframework/integration/aws/outbound/SnsMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -98,7 +98,6 @@ public class SnsMessageHandler extends AbstractAwsMessageHandler message, AwsRequest request, Throwable cause) { super(message, cause);