diff --git a/build.gradle b/build.gradle index 06d4d3c..7c191c0 100644 --- a/build.gradle +++ b/build.gradle @@ -7,11 +7,11 @@ plugins { id 'eclipse' id 'idea' id 'jacoco' - id 'org.sonarqube' version '4.3.0.3225' + id 'org.sonarqube' version '4.3.1.3277' id 'checkstyle' id 'org.ajoberstar.grgit' version '4.1.1' - id 'io.spring.dependency-management' version '1.1.2' - id 'com.jfrog.artifactory' version '4.33.1' + id 'io.spring.dependency-management' version '1.1.3' + id 'com.jfrog.artifactory' version '5.1.6' } description = 'Spring Integration AWS Support' @@ -31,16 +31,16 @@ repositories { ext { assertjVersion = '3.24.2' awaitilityVersion = '4.2.0' - awsSdkVersion = '2.20.83' + awsSdkVersion = '2.20.150' jacksonVersion = '2.15.2' - junitVersion = '5.9.3' + junitVersion = '5.10.0' log4jVersion = '2.20.0' servletApiVersion = '6.0.0' - springCloudAwsVersion = '3.0.1' - springIntegrationVersion = '6.0.6' - kinesisClientVersion = '2.5.1' + springCloudAwsVersion = '3.0.2' + springIntegrationVersion = '6.0.7' + kinesisClientVersion = '2.5.2' kinesisProducerVersion = '0.15.7' - testcontainersVersion = '1.18.3' + testcontainersVersion = '1.19.0' idPrefix = 'aws' @@ -103,7 +103,7 @@ jacoco { checkstyle { configDirectory.set(rootProject.file('src/checkstyle')) - toolVersion = '10.12.1' + toolVersion = '10.12.3' } dependencies { @@ -127,8 +127,6 @@ dependencies { optionalApi "jakarta.servlet:jakarta.servlet-api:$servletApiVersion" - testImplementation 'software.amazon.awssdk:apache-client' - testImplementation('org.springframework.integration:spring-integration-test') { exclude group: 'junit' } @@ -145,6 +143,7 @@ dependencies { testRuntimeOnly 'org.apache.logging.log4j:log4j-slf4j2-impl' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + testRuntimeOnly 'software.amazon.awssdk:aws-crt-client' } eclipse.project.natures += 'org.springframework.ide.eclipse.core.springnature' diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 033e24c..7f93135 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 c244788..864d6c4 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=03ec176d388f2aa99defcadc3ac6adf8dd2bce5145a129659537c0874dea5ad1 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionSha256Sum=591855b517fc635b9e04de1d05d5e76ada3f89f5fc76f87978d1b245b4f69225 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index fcb6fca..0adc8e1 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/src/main/java/org/springframework/integration/aws/inbound/kinesis/KclMessageDrivenChannelAdapter.java b/src/main/java/org/springframework/integration/aws/inbound/kinesis/KclMessageDrivenChannelAdapter.java index f95c9e8..00b2782 100644 --- a/src/main/java/org/springframework/integration/aws/inbound/kinesis/KclMessageDrivenChannelAdapter.java +++ b/src/main/java/org/springframework/integration/aws/inbound/kinesis/KclMessageDrivenChannelAdapter.java @@ -335,7 +335,10 @@ public class KclMessageDrivenChannelAdapter extends MessageProducerSupport ", stream(s)='" + Arrays.toString(this.streams) + "'}"; } - private class RecordProcessorFactory implements ShardRecordProcessorFactory { + private final class RecordProcessorFactory implements ShardRecordProcessorFactory { + + RecordProcessorFactory() { + } @Override public ShardRecordProcessor shardRecordProcessor() { @@ -349,7 +352,7 @@ public class KclMessageDrivenChannelAdapter extends MessageProducerSupport } - private class StreamsTracker implements MultiStreamTracker { + private final class StreamsTracker implements MultiStreamTracker { private final FormerStreamsLeasesDeletionStrategy formerStreamsLeasesDeletionStrategy = new FormerStreamsLeasesDeletionStrategy.AutoDetectionAndDeferredDeletionStrategy() { @@ -386,7 +389,7 @@ public class KclMessageDrivenChannelAdapter extends MessageProducerSupport /** * Processes records and checkpoints progress. */ - private class RecordProcessor implements ShardRecordProcessor { + private final class RecordProcessor implements ShardRecordProcessor { private final String stream; diff --git a/src/test/java/org/springframework/integration/aws/LocalstackContainerTest.java b/src/test/java/org/springframework/integration/aws/LocalstackContainerTest.java index b2ae916..faeaa59 100644 --- a/src/test/java/org/springframework/integration/aws/LocalstackContainerTest.java +++ b/src/test/java/org/springframework/integration/aws/LocalstackContainerTest.java @@ -24,7 +24,7 @@ import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.awscore.client.builder.AwsClientBuilder; -import software.amazon.awssdk.http.apache.ApacheHttpClient; +import software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.cloudwatch.CloudWatchAsyncClient; import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient; @@ -53,6 +53,10 @@ public interface LocalstackContainerTest { @BeforeAll static void startContainer() { LOCAL_STACK_CONTAINER.start(); + System.setProperty("software.amazon.awssdk.http.async.service.impl", + "software.amazon.awssdk.http.crt.AwsCrtSdkHttpService"); + System.setProperty("software.amazon.awssdk.http.service.impl", + "software.amazon.awssdk.http.apache.ApacheSdkHttpService"); } static DynamoDbAsyncClient dynamoDbClient() { @@ -60,7 +64,7 @@ public interface LocalstackContainerTest { } static KinesisAsyncClient kinesisClient() { - return applyAwsClientOptions(KinesisAsyncClient.builder()); + return applyAwsClientOptions(KinesisAsyncClient.builder().httpClientBuilder(NettyNioAsyncHttpClient.builder())); } static CloudWatchAsyncClient cloudWatchClient() { @@ -72,7 +76,7 @@ public interface LocalstackContainerTest { } static S3Client s3Client() { - return applyAwsClientOptions(S3Client.builder().httpClient(ApacheHttpClient.create())); + return applyAwsClientOptions(S3Client.builder()); } static SqsAsyncClient sqsClient() { diff --git a/src/test/java/org/springframework/integration/aws/inbound/KinesisMessageDrivenChannelAdapterTests.java b/src/test/java/org/springframework/integration/aws/inbound/KinesisMessageDrivenChannelAdapterTests.java index a2b42ab..dbc9e80 100644 --- a/src/test/java/org/springframework/integration/aws/inbound/KinesisMessageDrivenChannelAdapterTests.java +++ b/src/test/java/org/springframework/integration/aws/inbound/KinesisMessageDrivenChannelAdapterTests.java @@ -746,7 +746,8 @@ public class KinesisMessageDrivenChannelAdapterTests { } - private static class ExceptionReadyMetadataStore extends SimpleMetadataStore { + private static final class ExceptionReadyMetadataStore extends SimpleMetadataStore { + @Override public boolean replace(String key, String oldValue, String newValue) { if ("SpringIntegration:streamForResharding:closedShard4".equals(key)) { @@ -755,5 +756,7 @@ public class KinesisMessageDrivenChannelAdapterTests { return super.replace(key, oldValue, newValue); } + } + } diff --git a/src/test/java/org/springframework/integration/aws/outbound/S3MessageHandlerTests.java b/src/test/java/org/springframework/integration/aws/outbound/S3MessageHandlerTests.java index aa6156d..48775de 100644 --- a/src/test/java/org/springframework/integration/aws/outbound/S3MessageHandlerTests.java +++ b/src/test/java/org/springframework/integration/aws/outbound/S3MessageHandlerTests.java @@ -159,8 +159,7 @@ public class S3MessageHandlerTests implements LocalstackContainerTest { this.s3SendChannel.send(message); assertThat(transferCompletedLatch.await(10, TimeUnit.SECONDS)).isTrue(); - File outputFile = new File(temporaryFolder.toFile(), "outputFile"); - outputFile.createNewFile(); + File outputFile = new File(temporaryFolder.toFile(), "outputFile1"); GetObjectResponse getObjectResponse = S3.getObject(request -> request.bucket(S3_BUCKET_NAME).key("foo.mp3"), outputFile.toPath()) @@ -208,8 +207,7 @@ public class S3MessageHandlerTests implements LocalstackContainerTest { assertThat(transferCompletedLatch.await(10, TimeUnit.SECONDS)).isTrue(); - File outputFile = new File(temporaryFolder.toFile(), "outputFile"); - outputFile.createNewFile(); + File outputFile = new File(temporaryFolder.toFile(), "outputFile2"); GetObjectResponse getObjectResponse = S3.getObject(request -> request.bucket(S3_BUCKET_NAME).key("myStream"), outputFile.toPath()) @@ -245,8 +243,7 @@ public class S3MessageHandlerTests implements LocalstackContainerTest { assertThat(transferCompletedLatch.await(10, TimeUnit.SECONDS)).isTrue(); - File outputFile = new File(temporaryFolder.toFile(), "outputFile"); - outputFile.createNewFile(); + File outputFile = new File(temporaryFolder.toFile(), "outputFile3"); GetObjectResponse getObjectResponse = S3.getObject(request -> request.bucket(S3_BUCKET_NAME).key("myStream"), outputFile.toPath()) @@ -325,8 +322,7 @@ public class S3MessageHandlerTests implements LocalstackContainerTest { copy.completionFuture().join(); - File outputFile = new File(temporaryFolder.toFile(), "outputFile"); - outputFile.createNewFile(); + File outputFile = new File(temporaryFolder.toFile(), "outputFile4"); GetObjectResponse getObjectResponse = S3.getObject(request -> request.bucket("their-bucket").key("theirTarget"), outputFile.toPath())