diff --git a/README.md b/README.md index 7f5a0e7..3148154 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,17 @@ Spring Integration Extension for Amazon Web Services (AWS) ## Amazon Web Services (AWS) -Launched in 2006, [Amazon Web Services][] (AWS) provides key infrastructure services for business through its cloud computing platform. Using cloud computing businesses can adopt a new business model whereby they do not have to plan and invest in procuring their own IT infrastructure. They can use the infrastructure and services provided by the cloud service provider and pay as they use the services. Visit [https://aws.amazon.com/products/] for more details about various products offered by Amazon as a part their cloud computing services. +Launched in 2006, [Amazon Web Services][] (AWS) provides key infrastructure services for business through its cloud computing platform. +Using cloud computing businesses can adopt a new business model whereby they do not have to plan and invest in procuring their own IT infrastructure. +They can use the infrastructure and services provided by the cloud service provider and pay as they use the services. Visit [AWS Products](https://aws.amazon.com/products/) for more details about various products offered by Amazon as a part their cloud computing services. *Spring Integration Extension for Amazon Web Services* provides Spring Integration adapters for the various services provided by the [AWS SDK for Java][]. Note the Spring Integration AWS Extension is based on the [Spring Cloud AWS][] project. ## Spring Integration's extensions to AWS -The current project version is `2.4.x` and it requires minimum Java `8` and Spring Integration `5.4.x`. -Can be used with Spring Cloud `2020.0.x`. +The current project version is `2.5.x` and it requires minimum Java `8` and Spring Integration `5.5.x`. +Can be used with Spring Cloud `2020.0.x` Spring Cloud AWS `2.3.x`. This guide intends to explain briefly the various adapters available for [Amazon Web Services][] such as: @@ -21,8 +23,7 @@ This guide intends to explain briefly the various adapters available for [Amazon * **Amazon Simple Storage Service (S3)** * **Amazon Simple Queue Service (SQS)** * **Amazon Simple Notification Service (SNS)** -* **Amazon DynamoDB** (Analysis ongoing) -* **Amazon SimpleDB** (Not initiated) +* **Amazon DynamoDB** Sample XML Namespace configurations for each adapter as well as sample code snippets are provided wherever necessary. Of the above libraries, *SES* and *SNS* provide outbound adapters only. All other services have inbound and outbound adapters. The *SQS* inbound adapter is capable of receiving notifications sent out from *SNS* where the topic is an *SQS* Queue. @@ -37,7 +38,7 @@ Additionally, if you are contributing, we recommend following the process for Sp These dependencies are optional in the project: -* `org.springframework.cloud:spring-cloud-aws-messaging` - for SQS and SNS channel adapters +* `io.awspring.cloud:spring-cloud-aws-messaging` - for SQS and SNS channel adapters * `org.springframework.integration:spring-integration-file` - for S3 channel adapters * `org.springframework.integration:spring-integration-http` - for SNS inbound channel adapter * `com.amazonaws:aws-java-sdk-kinesis` - for Kinesis channel adapters @@ -294,7 +295,8 @@ See `SqsHeaderMapper` implementation for more information and also consult with ### Inbound Channel Adapter -The SQS Inbound Channel Adapter is a `message-driven` implementation for the `MessageProducer` and is represented with `SqsMessageDrivenChannelAdapter`. This channel adapter is based on the `org.springframework.cloud.aws.messaging.listener.SimpleMessageListenerContainer` to receive messages from the provided `queues` in async manner and send an enhanced Spring Integration Message to the provided `MessageChannel`. +The SQS Inbound Channel Adapter is a `message-driven` implementation for the `MessageProducer` and is represented with `SqsMessageDrivenChannelAdapter`. +This channel adapter is based on the `io.awspring.cloud.messaging.listener.SimpleMessageListenerContainer` to receive messages from the provided `queues` in async manner and send an enhanced Spring Integration Message to the provided `MessageChannel`. The enhancements include `AwsHeaders.MESSAGE_ID`, `AwsHeaders.RECEIPT_HANDLE` and `AwsHeaders.RECEIVED_QUEUE` message headers. The Java Configuration is pretty simple: @@ -640,7 +642,7 @@ When used with a shared `MessageGroupStore`, the `DynamoDbLockRegistry` can be u This implementation can also be used for the distributed leader elections using a [LockRegistryLeaderInitiator][]. The `com.amazonaws:dynamodb-lock-client` dependency must be present to make a `DynamoDbLockRegistry` working. -[Spring Cloud AWS]: https://github.com/spring-cloud/spring-cloud-aws +[Spring Cloud AWS]: https://awspring.io/ [AWS SDK for Java]: https://aws.amazon.com/sdkforjava/ [Amazon Web Services]: https://aws.amazon.com/ [https://aws.amazon.com/products/]: https://aws.amazon.com/products/ diff --git a/build.gradle b/build.gradle index 07b0595..68a5f6a 100644 --- a/build.gradle +++ b/build.gradle @@ -34,7 +34,7 @@ ext { servletApiVersion = '4.0.1' localstackVersion = '0.2.6' log4jVersion = '2.14.1' - springCloudAwsVersion = '2.2.5.RELEASE' + springCloudAwsVersion = '2.3.0' springIntegrationVersion = '5.5.0-SNAPSHOT' kinesisClientVersion = '1.14.0' kinesisProducerVersion = '0.14.3' @@ -85,7 +85,7 @@ dependencyManagement { enabled = false } imports { - mavenBom "org.springframework.cloud:spring-cloud-aws-dependencies:$springCloudAwsVersion" + mavenBom "io.awspring.cloud:spring-cloud-aws-dependencies:$springCloudAwsVersion" mavenBom "org.springframework.integration:spring-integration-bom:$springIntegrationVersion" mavenBom "com.fasterxml.jackson:jackson-bom:$jacksonVersion" mavenBom "org.junit:junit-bom:$junitVersion" @@ -103,10 +103,10 @@ checkstyle { dependencies { api 'org.springframework.integration:spring-integration-core' - api 'org.springframework.cloud:spring-cloud-aws-core' + api 'io.awspring.cloud:spring-cloud-aws-core' api 'com.fasterxml.jackson.core:jackson-databind' - optionalApi 'org.springframework.cloud:spring-cloud-aws-messaging' + optionalApi 'io.awspring.cloud:spring-cloud-aws-messaging' optionalApi 'org.springframework.integration:spring-integration-file' optionalApi 'org.springframework.integration:spring-integration-http' 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 dad3024..96b9a66 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-2019 the original author or authors. + * Copyright 2016-2021 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. @@ -22,8 +22,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.springframework.cloud.aws.messaging.endpoint.NotificationStatus; -import org.springframework.cloud.aws.messaging.endpoint.NotificationStatusHandlerMethodArgumentResolver; import org.springframework.expression.EvaluationContext; import org.springframework.expression.Expression; import org.springframework.http.HttpHeaders; @@ -44,6 +42,8 @@ import org.springframework.web.multipart.MultipartResolver; import com.amazonaws.services.sns.AmazonSNS; import com.fasterxml.jackson.databind.JsonNode; +import io.awspring.cloud.messaging.endpoint.NotificationStatus; +import io.awspring.cloud.messaging.endpoint.NotificationStatusHandlerMethodArgumentResolver; /** * The {@link HttpRequestHandlingMessagingGateway} extension for the Amazon WS SNS HTTP(S) diff --git a/src/main/java/org/springframework/integration/aws/inbound/SqsMessageDrivenChannelAdapter.java b/src/main/java/org/springframework/integration/aws/inbound/SqsMessageDrivenChannelAdapter.java index 5f9c121..6a11d43 100644 --- a/src/main/java/org/springframework/integration/aws/inbound/SqsMessageDrivenChannelAdapter.java +++ b/src/main/java/org/springframework/integration/aws/inbound/SqsMessageDrivenChannelAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 the original author or authors. + * Copyright 2016-2021 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. @@ -24,11 +24,6 @@ import java.util.Set; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.DisposableBean; -import org.springframework.cloud.aws.core.env.ResourceIdResolver; -import org.springframework.cloud.aws.messaging.config.SimpleMessageListenerContainerFactory; -import org.springframework.cloud.aws.messaging.listener.QueueMessageHandler; -import org.springframework.cloud.aws.messaging.listener.SimpleMessageListenerContainer; -import org.springframework.cloud.aws.messaging.listener.SqsMessageDeletionPolicy; import org.springframework.core.task.AsyncTaskExecutor; import org.springframework.integration.aws.support.AwsHeaders; import org.springframework.integration.endpoint.MessageProducerSupport; @@ -43,6 +38,11 @@ import org.springframework.messaging.handler.HandlerMethod; import org.springframework.util.Assert; import com.amazonaws.services.sqs.AmazonSQSAsync; +import io.awspring.cloud.core.env.ResourceIdResolver; +import io.awspring.cloud.messaging.config.SimpleMessageListenerContainerFactory; +import io.awspring.cloud.messaging.listener.QueueMessageHandler; +import io.awspring.cloud.messaging.listener.SimpleMessageListenerContainer; +import io.awspring.cloud.messaging.listener.SqsMessageDeletionPolicy; /** * The {@link MessageProducerSupport} implementation for the Amazon SQS diff --git a/src/main/java/org/springframework/integration/aws/outbound/S3MessageHandler.java b/src/main/java/org/springframework/integration/aws/outbound/S3MessageHandler.java index 78b1c2c..4eed3bf 100644 --- a/src/main/java/org/springframework/integration/aws/outbound/S3MessageHandler.java +++ b/src/main/java/org/springframework/integration/aws/outbound/S3MessageHandler.java @@ -21,7 +21,6 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; -import org.springframework.cloud.aws.core.env.ResourceIdResolver; import org.springframework.expression.EvaluationContext; import org.springframework.expression.Expression; import org.springframework.expression.common.LiteralExpression; @@ -56,6 +55,7 @@ import com.amazonaws.services.s3.transfer.internal.S3ProgressListener; import com.amazonaws.services.s3.transfer.internal.S3ProgressListenerChain; import com.amazonaws.util.Base64; import com.amazonaws.util.Md5Utils; +import io.awspring.cloud.core.env.ResourceIdResolver; /** * The {@link AbstractReplyProducingMessageHandler} implementation for the Amazon S3 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 7ec00ba..d845f05 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-2019 the original author or authors. + * Copyright 2016-2021 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. @@ -20,7 +20,6 @@ import java.util.HashMap; import java.util.Map; import java.util.concurrent.Future; -import org.springframework.cloud.aws.core.env.ResourceIdResolver; import org.springframework.expression.Expression; import org.springframework.expression.TypeLocator; import org.springframework.expression.common.LiteralExpression; @@ -39,6 +38,7 @@ import com.amazonaws.services.sns.AmazonSNSAsync; import com.amazonaws.services.sns.model.MessageAttributeValue; import com.amazonaws.services.sns.model.PublishRequest; import com.amazonaws.services.sns.model.PublishResult; +import io.awspring.cloud.core.env.ResourceIdResolver; /** * The {@link AbstractAwsMessageHandler} implementation to send SNS Notifications diff --git a/src/main/java/org/springframework/integration/aws/outbound/SqsMessageHandler.java b/src/main/java/org/springframework/integration/aws/outbound/SqsMessageHandler.java index f4ecda9..b24ee05 100644 --- a/src/main/java/org/springframework/integration/aws/outbound/SqsMessageHandler.java +++ b/src/main/java/org/springframework/integration/aws/outbound/SqsMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 the original author or authors. + * Copyright 2016-2021 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. @@ -20,8 +20,6 @@ import java.util.HashMap; import java.util.Map; import java.util.concurrent.Future; -import org.springframework.cloud.aws.core.env.ResourceIdResolver; -import org.springframework.cloud.aws.messaging.support.destination.DynamicQueueUrlDestinationResolver; import org.springframework.expression.Expression; import org.springframework.expression.common.LiteralExpression; import org.springframework.integration.aws.support.AwsHeaders; @@ -45,6 +43,8 @@ import com.amazonaws.services.sqs.model.SendMessageBatchRequest; import com.amazonaws.services.sqs.model.SendMessageBatchResult; import com.amazonaws.services.sqs.model.SendMessageRequest; import com.amazonaws.services.sqs.model.SendMessageResult; +import io.awspring.cloud.core.env.ResourceIdResolver; +import io.awspring.cloud.messaging.support.destination.DynamicQueueUrlDestinationResolver; /** * The {@link AbstractMessageHandler} implementation for the Amazon SQS diff --git a/src/main/java/org/springframework/integration/aws/support/AbstractMessageAttributesHeaderMapper.java b/src/main/java/org/springframework/integration/aws/support/AbstractMessageAttributesHeaderMapper.java index 9381ad4..5f8a219 100644 --- a/src/main/java/org/springframework/integration/aws/support/AbstractMessageAttributesHeaderMapper.java +++ b/src/main/java/org/springframework/integration/aws/support/AbstractMessageAttributesHeaderMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2019 the original author or authors. + * Copyright 2018-2021 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. @@ -24,7 +24,6 @@ import java.util.UUID; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.cloud.aws.messaging.core.MessageAttributeDataTypes; import org.springframework.integration.mapping.HeaderMapper; import org.springframework.integration.support.utils.PatternMatchUtils; import org.springframework.messaging.MessageHeaders; @@ -32,6 +31,8 @@ import org.springframework.util.Assert; import org.springframework.util.MimeType; import org.springframework.util.NumberUtils; +import io.awspring.cloud.messaging.core.MessageAttributeDataTypes; + /** * Base {@link HeaderMapper} implementation for common logic in SQS and SNS around message * attributes mapping. diff --git a/src/main/java/org/springframework/integration/aws/support/S3Session.java b/src/main/java/org/springframework/integration/aws/support/S3Session.java index efc4f4e..d8bffed 100644 --- a/src/main/java/org/springframework/integration/aws/support/S3Session.java +++ b/src/main/java/org/springframework/integration/aws/support/S3Session.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 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. @@ -24,7 +24,6 @@ import java.util.List; import org.apache.http.HttpStatus; -import org.springframework.cloud.aws.core.env.ResourceIdResolver; import org.springframework.integration.file.remote.session.Session; import org.springframework.util.Assert; import org.springframework.util.StreamUtils; @@ -40,6 +39,7 @@ import com.amazonaws.services.s3.model.ObjectMetadata; import com.amazonaws.services.s3.model.S3Object; import com.amazonaws.services.s3.model.S3ObjectInputStream; import com.amazonaws.services.s3.model.S3ObjectSummary; +import io.awspring.cloud.core.env.ResourceIdResolver; /** * An Amazon S3 {@link Session} implementation. diff --git a/src/main/java/org/springframework/integration/aws/support/S3SessionFactory.java b/src/main/java/org/springframework/integration/aws/support/S3SessionFactory.java index b0d25b6..0a5c17b 100644 --- a/src/main/java/org/springframework/integration/aws/support/S3SessionFactory.java +++ b/src/main/java/org/springframework/integration/aws/support/S3SessionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 the original author or authors. + * Copyright 2016-2021 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. @@ -16,7 +16,6 @@ package org.springframework.integration.aws.support; -import org.springframework.cloud.aws.core.env.ResourceIdResolver; import org.springframework.integration.file.remote.session.SessionFactory; import org.springframework.integration.file.remote.session.SharedSessionCapable; import org.springframework.util.Assert; @@ -24,6 +23,7 @@ import org.springframework.util.Assert; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3ClientBuilder; import com.amazonaws.services.s3.model.S3ObjectSummary; +import io.awspring.cloud.core.env.ResourceIdResolver; /** * An Amazon S3 specific {@link SessionFactory} implementation. Also this class implements diff --git a/src/main/java/org/springframework/integration/aws/support/SqsHeaderMapper.java b/src/main/java/org/springframework/integration/aws/support/SqsHeaderMapper.java index d81f555..37a3458 100644 --- a/src/main/java/org/springframework/integration/aws/support/SqsHeaderMapper.java +++ b/src/main/java/org/springframework/integration/aws/support/SqsHeaderMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2019 the original author or authors. + * Copyright 2018-2021 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. @@ -27,7 +27,7 @@ import com.amazonaws.services.sqs.model.MessageAttributeValue; * headers to SQS message attributes. *
* The
- * {@link org.springframework.cloud.aws.messaging.listener.SimpleMessageListenerContainer}
+ * {@link io.awspring.cloud.messaging.listener.SimpleMessageListenerContainer}
* maps all the SQS message attributes to the {@link MessageHeaders}.
*
* @author Artem Bilan
diff --git a/src/main/resources/org/springframework/integration/aws/config/spring-integration-aws.xsd b/src/main/resources/org/springframework/integration/aws/config/spring-integration-aws.xsd
index 7cc57ed..486ce3d 100644
--- a/src/main/resources/org/springframework/integration/aws/config/spring-integration-aws.xsd
+++ b/src/main/resources/org/springframework/integration/aws/config/spring-integration-aws.xsd
@@ -237,11 +237,11 @@