Skip to content

Commit

Permalink
Upgrade dependencies, including Gradle
Browse files Browse the repository at this point in the history
* Migrate to `DEVELOCITY_ACCESS_KEY` secret for GHA
* Fix classes compatibility with Java 21
  • Loading branch information
artembilan committed Sep 23, 2024
1 parent a8d7534 commit 5cfdaa2
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -102,7 +102,7 @@ dependencyManagement {

checkstyle {
configDirectory.set(rootProject.file('src/checkstyle'))
toolVersion = '10.12.4'
toolVersion = '10.18.1'
}

dependencies {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion publish-maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ publishing {
developer {
id = 'artembilan'
name = 'Artem Bilan'
email = 'abilan@vmware.com'
email = 'artem.bilan@broadcom.com'
roles = ['project lead']
}
}
Expand Down
3 changes: 1 addition & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
Expand All @@ -91,17 +93,10 @@ public SnsInboundChannelAdapter(SnsClient amazonSns, String... path) {
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) {
Expand All @@ -111,6 +106,14 @@ public void setHandleNotificationStatus(boolean handleNotificationStatus) {
@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();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -83,10 +83,16 @@ protected Expression getSendTimeoutExpression() {
* @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;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -98,7 +98,6 @@ public SnsMessageHandler(SnsAsyncClient amazonSns) {
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) {
Expand Down Expand Up @@ -188,13 +187,14 @@ public void setBodyExpression(Expression bodyExpression) {
@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");
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -149,6 +148,7 @@ public void setMessageConverter(MessageConverter messageConverter) {
@Override
protected void onInit() {
super.onInit();
setHeaderMapper(new SqsHeaderMapper());
if (this.messageConverter == null) {
this.messageConverter = new GenericMessageConverter(getConversionService());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5cfdaa2

Please sign in to comment.