From e5acf0f4dea76aefce5a4595e7343a1fe99e9609 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Mon, 25 Feb 2019 13:14:44 -0500 Subject: [PATCH] Upgrade dependencies; fix for compatibility --- build.gradle | 18 +++++++++--------- .../aws/inbound/SnsInboundChannelAdapter.java | 9 +++++---- .../KclMessageDrivenChannelAdapter.java | 2 +- .../outbound/AbstractAwsMessageHandler.java | 4 ++-- .../aws/outbound/KplMessageHandler.java | 10 +++++++--- .../aws/outbound/SnsMessageHandler.java | 6 +++--- .../aws/outbound/SqsMessageHandler.java | 4 ++-- 7 files changed, 29 insertions(+), 24 deletions(-) diff --git a/build.gradle b/build.gradle index 2f60b54..53332fb 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ buildscript { maven { url 'http://repo.spring.io/plugins-release' } } dependencies { - classpath 'io.spring.gradle:dependency-management-plugin:1.0.6.RELEASE' + classpath 'io.spring.gradle:dependency-management-plugin:1.0.7.RELEASE' } } @@ -12,7 +12,7 @@ plugins { id 'eclipse' id 'idea' id 'jacoco' - id 'org.sonarqube' version '2.6.2' + id 'org.sonarqube' version '2.7' id 'checkstyle' } description = 'Spring Integration AWS Support' @@ -30,13 +30,13 @@ repositories { } ext { - assertjVersion = '3.11.1' + assertjVersion = '3.12.0' dynamodbLockClientVersion = '1.0.0' - jacksonVersion = '2.9.7' - servletApiVersion = '4.0.0' - log4jVersion = '2.11.1' - springCloudAwsVersion = '2.1.0.BUILD-SNAPSHOT' - springIntegrationVersion = '5.1.0.RELEASE' + jacksonVersion = '2.9.8' + servletApiVersion = '4.0.1' + log4jVersion = '2.11.2' + springCloudAwsVersion = '2.1.1.BUILD-SNAPSHOT' + springIntegrationVersion = '5.1.4.BUILD-SNAPSHOT' kinesisClientVersion = '2.0.5' kinesisProducerVersion = '0.12.11' @@ -82,7 +82,7 @@ jacoco { checkstyle { configFile = file("${rootDir}/src/checkstyle/checkstyle.xml") - toolVersion = "8.14" + toolVersion = "8.17" } dependencies { 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 60ea0bc..78b0108 100644 --- a/src/main/java/org/springframework/integration/aws/inbound/SnsInboundChannelAdapter.java +++ b/src/main/java/org/springframework/integration/aws/inbound/SnsInboundChannelAdapter.java @@ -49,15 +49,16 @@ import com.fasterxml.jackson.databind.JsonNode; * The {@link HttpRequestHandlingMessagingGateway} extension for the Amazon WS SNS HTTP(S) endpoints. * Accepts all {@code x-amz-sns-message-type}s, converts the received Topic JSON message to the * {@link Map} using {@link MappingJackson2HttpMessageConverter} and send it to the provided - * {@link #requestChannel} as {@link Message} {@code payload}. + * {@link #getRequestChannel()} as {@link Message} {@code payload}. *

* The mapped url must be configured inside the Amazon Web Service platform as a subscription. * Before receiving any notification itself this HTTP endpoint must confirm the subscription. *

* The {@link #handleNotificationStatus} flag (defaults to {@code false}) indicates that * this endpoint should send the {@code SubscriptionConfirmation/UnsubscribeConfirmation} - * messages to the the provided {@link #requestChannel}. If that, the {@link AwsHeaders#NOTIFICATION_STATUS} - * header is populated with the {@link NotificationStatus} value. In that case it is a responsibility of + * messages to the the provided {@link #getRequestChannel()}. + * If that, the {@link AwsHeaders#NOTIFICATION_STATUS} header is populated + * with the {@link NotificationStatus} value. In that case it is a responsibility of * the application to {@link NotificationStatus#confirmSubscription()} or not. *

* By default this endpoint just does {@link NotificationStatus#confirmSubscription()} @@ -106,7 +107,7 @@ public class SnsInboundChannelAdapter extends HttpRequestHandlingMessagingGatewa } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); if (this.payloadExpression != null) { this.evaluationContext = createEvaluationContext(); 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 d21bd80..3692a4d 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 @@ -1,5 +1,5 @@ /* - * Copyright 2017-2018 the original author or authors. + * Copyright 2019 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. 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 e0c6410..0eaccd7 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-2018 the original author or authors. + * Copyright 2017-2019 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. @@ -167,7 +167,7 @@ public abstract class AbstractAwsMessageHandler extends AbstractMessageProduc } @Override - protected void onInit() throws Exception { + protected void onInit() { super.onInit(); this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); } diff --git a/src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java b/src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java index 7e6e390..b1bbcc8 100644 --- a/src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java +++ b/src/main/java/org/springframework/integration/aws/outbound/KplMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2018 the original author or authors. + * Copyright 2019 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. @@ -188,9 +188,13 @@ public class KplMessageHandler extends AbstractAwsMessageHandler { final AsyncHandler asyncHandler = obtainAsyncHandler(message, putRecordRequest); final FutureCallback callback = new FutureCallback() { + @Override - public void onFailure(Throwable t) { - asyncHandler.onError((t instanceof Exception) ? ((Exception) t) : new AwsRequestFailureException(message, putRecordRequest, t)); + public void onFailure(Throwable ex) { + asyncHandler + .onError(ex instanceof Exception ? + (Exception) ex : + new AwsRequestFailureException(message, putRecordRequest, ex)); } @Override 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 72c95ae..cb9a8f4 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-2018 the original author or authors. + * Copyright 2016-2019 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. @@ -61,7 +61,7 @@ import com.amazonaws.services.sns.model.PublishResult; * the SNS Message is built from there and the {@code messageStructure} * of the {@link PublishRequest} is set to {@code json}. * For the convenience the package {@code org.springframework.integration.aws.support} is imported - * to the {@link #evaluationContext} to allow bypass it for the {@link SnsBodyBuilder} + * to the {@link #getEvaluationContext()} to allow bypass it for the {@link SnsBodyBuilder} * from the {@link #bodyExpression} definition. For example: *

  * {@code
@@ -143,7 +143,7 @@ public class SnsMessageHandler extends AbstractAwsMessageHandler