Upgrade dependencies, including Gradle

* Migrate to `DEVELOCITY_ACCESS_KEY` secret for GHA
* Fix classes compatibility with Java 21
This commit is contained in:
Artem Bilan
2024-09-23 15:47:12 -04:00
parent a8d75346a4
commit 5cfdaa2ae8
13 changed files with 51 additions and 37 deletions

View File

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

View File

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

View File

@@ -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 {

Binary file not shown.

View File

@@ -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

View File

@@ -33,7 +33,7 @@ publishing {
developer {
id = 'artembilan'
name = 'Artem Bilan'
email = 'abilan@vmware.com'
email = 'artem.bilan@broadcom.com'
roles = ['project lead']
}
}

View File

@@ -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'

View File

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

View File

@@ -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";

View File

@@ -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<H> extends AbstractMessageProduc
* @param headerMapper the {@link HeaderMapper} to map outbound headers.
*/
public void setHeaderMapper(HeaderMapper<H> headerMapper) {
doSetHeaderMapper(headerMapper);
this.headerMapper = headerMapper;
}
protected final void doSetHeaderMapper(HeaderMapper<H> 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<H> headerMapper) {
this.headerMapper = headerMapper;
}

View File

@@ -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<Map<String, Mes
Assert.notNull(amazonSns, "amazonSns must not be null.");
this.amazonSns = amazonSns;
this.topicArnResolver = new CachingTopicArnResolver(new SnsAsyncTopicArnResolver(this.amazonSns));
doSetHeaderMapper(new SnsHeaderMapper());
}
public void setTopicArn(String topicArn) {
@@ -188,13 +187,14 @@ public class SnsMessageHandler extends AbstractAwsMessageHandler<Map<String, Mes
@Override
protected void onInit() {
super.onInit();
setHeaderMapper(new SnsHeaderMapper());
TypeLocator typeLocator = getEvaluationContext().getTypeLocator();
if (typeLocator instanceof StandardTypeLocator) {
if (typeLocator instanceof StandardTypeLocator standardTypeLocator) {
/*
* Register the 'org.springframework.integration.aws.support' package you
* don't need a FQCN for the 'SnsBodyBuilder'.
*/
((StandardTypeLocator) typeLocator).registerImport("org.springframework.integration.aws.support");
standardTypeLocator.registerImport("org.springframework.integration.aws.support");
}
}

View File

@@ -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.
@@ -76,7 +76,6 @@ public class SqsMessageHandler extends AbstractAwsMessageHandler<Map<String, Mes
public SqsMessageHandler(SqsAsyncClient amazonSqs) {
Assert.notNull(amazonSqs, "'amazonSqs' must not be null");
this.amazonSqs = amazonSqs;
doSetHeaderMapper(new SqsHeaderMapper());
}
public void setQueue(String queue) {
@@ -149,6 +148,7 @@ public class SqsMessageHandler extends AbstractAwsMessageHandler<Map<String, Mes
@Override
protected void onInit() {
super.onInit();
setHeaderMapper(new SqsHeaderMapper());
if (this.messageConverter == null) {
this.messageConverter = new GenericMessageConverter(getConversionService());
}

View File

@@ -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.
@@ -33,7 +33,7 @@ public class AwsRequestFailureException extends MessagingException {
private static final long serialVersionUID = 1L;
private final AwsRequest request;
private final transient AwsRequest request;
public AwsRequestFailureException(Message<?> message, AwsRequest request, Throwable cause) {
super(message, cause);