163 Commits

Author SHA1 Message Date
Artem Bilan
e7f853abb2 Add HTTPS entries for XSD into spring.schemas
Related to spring-projects/spring-integration#2987

**Cherry-pick to 2.1.x, 2.0.x & 1.1.x**

# Conflicts:
#	src/main/resources/META-INF/spring.schemas

# Conflicts:
#	src/main/resources/META-INF/spring.schemas
2019-07-18 13:23:40 -04:00
Spring Operator
f50644aaaa URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://aws.amazon.com/ with 1 occurrences migrated to:
  https://aws.amazon.com/ ([https](https://aws.amazon.com/) result 200).
* [ ] http://aws.amazon.com/products/ with 3 occurrences migrated to:
  https://aws.amazon.com/products/ ([https](https://aws.amazon.com/products/) result 200).
* [ ] http://aws.amazon.com/ses/ with 2 occurrences migrated to:
  https://aws.amazon.com/ses/ ([https](https://aws.amazon.com/ses/) result 200).
* [ ] http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html with 1 occurrences migrated to:
  https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html ([https](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html) result 200).
* [ ] http://docs.spring.io/spring-integration/reference/ with 1 occurrences migrated to:
  https://docs.spring.io/spring-integration/reference/ ([https](https://docs.spring.io/spring-integration/reference/) result 200).
* [ ] http://projects.spring.io/spring-integration/ with 1 occurrences migrated to:
  https://projects.spring.io/spring-integration/ ([https](https://projects.spring.io/spring-integration/) result 200).
* [ ] http://www.apache.org with 1 occurrences migrated to:
  https://www.apache.org ([https](https://www.apache.org) result 200).
* [ ] http://www.springframework.org/schema/integration/spring-integration.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/integration/spring-integration.xsd ([https](https://www.springframework.org/schema/integration/spring-integration.xsd) result 200).
* [ ] http://aws.amazon.com/documentation/ses/ with 2 occurrences migrated to:
  https://aws.amazon.com/documentation/ses/ ([https](https://aws.amazon.com/documentation/ses/) result 301).
* [ ] http://aws.amazon.com/sdkforjava/ with 1 occurrences migrated to:
  https://aws.amazon.com/sdkforjava/ ([https](https://aws.amazon.com/sdkforjava/) result 301).
* [ ] http://contributor-covenant.org with 1 occurrences migrated to:
  https://contributor-covenant.org ([https](https://contributor-covenant.org) result 301).
* [ ] http://contributor-covenant.org/version/1/3/0/ with 1 occurrences migrated to:
  https://contributor-covenant.org/version/1/3/0/ ([https](https://contributor-covenant.org/version/1/3/0/) result 301).
* [ ] http://www.springframework.org with 1 occurrences migrated to:
  https://www.springframework.org ([https](https://www.springframework.org) result 301).

# Ignored
These URLs were intentionally ignored.

* http://localhost with 4 occurrences
* http://testQueue.amazonaws.com with 2 occurrences
* http://www.springframework.org/schema/beans with 1 occurrences
* http://www.springframework.org/schema/integration with 2 occurrences
* http://www.springframework.org/schema/integration/aws with 2 occurrences
* http://www.springframework.org/schema/tool with 2 occurrences
* http://www.w3.org/2001/XMLSchema with 1 occurrences
2019-03-27 13:40:08 -04:00
Spring Operator
ea566ce120 URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* [ ] http://www.puppycrawl.com/dtds/configuration_1_2.dtd (404) with 1 occurrences migrated to:
  https://www.puppycrawl.com/dtds/configuration_1_2.dtd ([https](https://www.puppycrawl.com/dtds/configuration_1_2.dtd) result 404).
* [ ] http://www.puppycrawl.com/dtds/suppressions_1_1.dtd (404) with 1 occurrences migrated to:
  https://www.puppycrawl.com/dtds/suppressions_1_1.dtd ([https](https://www.puppycrawl.com/dtds/suppressions_1_1.dtd) result 404).
* [ ] http://www.springframework.org/schema/cloud/aws/messaging/spring-cloud-aws-messaging.xsd (404) with 7 occurrences migrated to:
  https://www.springframework.org/schema/cloud/aws/messaging/spring-cloud-aws-messaging.xsd ([https](https://www.springframework.org/schema/cloud/aws/messaging/spring-cloud-aws-messaging.xsd) result 404).

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.springframework.org/schema/beans/spring-beans.xsd with 12 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans.xsd ([https](https://www.springframework.org/schema/beans/spring-beans.xsd) result 200).
* [ ] http://www.springframework.org/schema/integration/aws/spring-integration-aws.xsd with 12 occurrences migrated to:
  https://www.springframework.org/schema/integration/aws/spring-integration-aws.xsd ([https](https://www.springframework.org/schema/integration/aws/spring-integration-aws.xsd) result 200).
* [ ] http://www.springframework.org/schema/integration/spring-integration.xsd with 4 occurrences migrated to:
  https://www.springframework.org/schema/integration/spring-integration.xsd ([https](https://www.springframework.org/schema/integration/spring-integration.xsd) result 200).

# Ignored
These URLs were intentionally ignored.

* http://www.springframework.org/schema/beans with 24 occurrences
* http://www.springframework.org/schema/cloud/aws/messaging with 14 occurrences
* http://www.springframework.org/schema/integration with 8 occurrences
* http://www.springframework.org/schema/integration/aws with 24 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 12 occurrences
2019-03-27 13:14:55 -04:00
Spring Operator
431edcc309 URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 70 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
2019-03-25 12:50:13 -04:00
Spring Operator
7ecd6c45ef URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/ with 1 occurrences migrated to:
  https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/ ([https](https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/) result 200).
* http://spring.io with 1 occurrences migrated to:
  https://spring.io ([https](https://spring.io) result 200).
* http://www.apache.org/licenses/LICENSE-2.0.txt with 1 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0.txt ([https](https://www.apache.org/licenses/LICENSE-2.0.txt) result 200).
* http://repo.spring.io/libs-milestone with 1 occurrences migrated to:
  https://repo.spring.io/libs-milestone ([https](https://repo.spring.io/libs-milestone) result 302).
* http://repo.spring.io/libs-staging-local with 1 occurrences migrated to:
  https://repo.spring.io/libs-staging-local ([https](https://repo.spring.io/libs-staging-local) result 302).
* http://repo.spring.io/plugins-release with 1 occurrences migrated to:
  https://repo.spring.io/plugins-release ([https](https://repo.spring.io/plugins-release) result 302).
2019-03-16 12:52:05 -04:00
Spring Buildmaster
0d6a1e71e2 [artifactory-release] Next development version 2019-02-14 21:59:13 +00:00
Spring Buildmaster
d89514fef6 [artifactory-release] Release version 2.0.1.RELEASE 2019-02-14 21:59:10 +00:00
Artem Bilan
4f1f839c9e Upgrade dependencies; prepare for release 2019-02-14 16:53:55 -05:00
Artem Bilan
0ea00784f0 Use default LocalStack ports
According to https://github.com/localstack/localstack,
DynamoDB listens at `4569` by default, and Kinesis listens at `4568`
 by default.

Aligning with that setup means that it is simpler to run these tests
without having to tune the LocalStack ports.

See also: https://github.com/spring-cloud/spring-cloud-stream-binder-aws-kinesis/pull/64
2018-10-08 10:27:09 -04:00
Karl Lessard
ed89f1243f GH-97: wait at least leaseDuration to acquire the lock
Fixes https://github.com/spring-projects/spring-integration-aws/issues/97

This fixes an issue where `additionalTimeToWait` has a negative value
that is subtracted later by the Amazon DynamoDB client to
`leaseDuration`, making it impossible to acquire the lock if expired.

Also allow to use the existing `refreshPeriod` properties in this case.

* Use default refresh period in tryLock()

The 'refreshPeriod' value might not satisfy both tryLock() and lock()
requirements and should probably be used exclusively in the second case.

We can make the value used for tryLock() configurable as well in another
pull request.

* Rollback previous commit and add author name
2018-09-21 15:46:04 -04:00
Artem Bilan
857d184cca Fix KinesisMessageDrivenChannelAdapterTests
There is a race condition when real consumers are started later in
different thread.

* Add `eventually()` matcher to check the `Map<KinesisShardOffset, ?> shardConsumers`
for particular keys to appear eventually
2018-09-19 13:07:58 -04:00
skelly201
6e5e9f191b Add SqsMessageHandler DestinationResolver ctor 2018-09-19 11:27:27 -04:00
Spring Buildmaster
4476c09f61 [artifactory-release] Next development version 2018-08-21 17:34:32 +00:00
Spring Buildmaster
4043c150d1 [artifactory-release] Release version 2.0.0.RELEASE 2018-08-21 17:34:27 +00:00
Artem Bilan
2cbe87f90d Fix README typos 2018-08-01 16:32:40 -04:00
Spring Buildmaster
7c1e3f83fa [artifactory-release] Next development version 2018-07-30 14:33:53 +00:00
Spring Buildmaster
33048d892e [artifactory-release] Release version 2.0.0.RC1 2018-07-30 14:33:47 +00:00
Artem Bilan
19d11057c2 Upgrade to the latest dependencies 2018-07-27 17:00:16 -04:00
Artem Bilan
1e1e1acc39 Fix DynamoDbLockRegistry.tryLock for "fair" time
Since we don't have choice and wait at minimum `leaseDuration` to be
able to iterate in the Amazon LockClient at least two times and that is
going to be just a contract of this client, so we need to add up a
`timeout` for the `tryLock` to that `leaseDuration`
2018-07-20 12:44:51 -04:00
Artem Bilan
dd52e8f304 Fix DynamoDbLockReg for LockClient requirements
https://stackoverflow.com/questions/51428196/spring-aws-kinesis-binder-acquiring-and-releasing-lock-issues-in-dynamo-db-while

According the logic in the `AmazonDynamoDBLockClient.acquireLock()` we
need to let the loop to iterate at least twice to really get access to
the existing lock and check its expiration status

* Fix the `DynamoDbLockRegistry.tryLock()` to set a proper
`.withRefreshPeriod(0L)` and `.withRefreshPeriod(0L)` to let it pull
the DB until we reach a `leaseDuration` limit on the lock or its
expiration status
2018-07-19 18:21:23 -04:00
Artem Bilan
0e02b0d470 GH-90: Rework locking logic in the KinesisMDChA
Fixes https://github.com/spring-projects/spring-integration-aws/issues/90

* Add an internal `ShardConsumerManager` which is responsible to initiate
a locking for the shard key in the provided consumer group and populating
a `ShardConsumer` if `tryLock()` is successful or no `LockRegistry` at all
* Additional logic is added to always iterate over candidate shards if
`tryLock()` on the matter is not successful.
This way the current `KinesisMessageDrivenChannelAdapter` picks up
those shards which have been locked by the consumer which has just
left a cluster and unlocked distributed locks
* Now all the shards are considered as candidates independently of the
`streams` or `shardOffsets` configuration
* Improve Kinesis tests performance
2018-07-16 13:17:13 -04:00
Artem Bilan
fc34f814e5 Fix DynamoDbMetadataStore.initialized flag logic
https://stackoverflow.com/questions/51257855/spring-cloud-aws-kinesis-stream-binder-failed-to-start-due-to-improper-bean-init
2018-07-10 13:46:30 -04:00
Artem Bilan
3a279ca67f Rename DynamoDbMetadataStore class for consistency 2018-07-02 20:52:40 -04:00
Artem Bilan
19b21579dc Change DynamoDbLocalRunning default port to 4568
To be able to run Kinesalite and Dynalite npm services locally in
parallel, we need to provide unique ports for them.
Therefore a default `4567` is left for the Kinesalite, meanwhile the
`DynamoDbLocalRunning` is expecting a 4568 now
2018-07-02 13:30:39 -04:00
Artem Bilan
662416cd7b Fix DynamoDbLock.tryLock() for the real timeout
Since the contract of the `tryLock()` to wait as close to the provided
timeout as possible, then we should not wait for the `leasePeriod` as
minimum.
Also we should sleep in between attempts not more then provided timeout
2018-06-28 12:43:35 -04:00
Artem Bilan
d192e17007 Protect DynamoLockReg & DynamoMDS from hanging
If `DynamoDbLockRegistry` and `DynamoDbMetaDataStore` are not declared
as beans (or their `afterPropertiesSet()` is not called), they hanging on
the `awaitForActive()`
2018-06-28 11:47:59 -04:00
Artem Bilan
9e14e86880 Fix DynamoDbLockRegistry.tryLock for fair time
When we try to lock the DynamoDB item we need to iterate at least
the lease time, but we still don't need to sleep too much - maximum
the time requested for `tryLock()`
2018-06-26 20:46:46 -04:00
Artem Bilan
3e603185a7 Fix race condition in KinesisMDCA.doStop()
https://build.spring.io/browse/INTEXT-AWS-158
2018-06-26 16:44:05 -04:00
Artem Bilan
4fe8e4c6a5 Fix timing issue in the KinesisMDChATests
https://build.spring.io/browse/INTEXT-AWS-157
2018-06-26 15:21:56 -04:00
Artem Bilan
133731f288 Fix race condition in the KinesisMDChATests 2018-06-26 13:34:01 -04:00
Artem Bilan
8247d0df1b Fix S3 Channel Adapters to use filter by default 2018-06-26 13:14:25 -04:00
Artem Bilan
6f39406309 Fix race condition: KinesisMDCA.consumerInvokers
https://build.spring.io/browse/INTEXT-AWS-JOB1-154
2018-06-25 21:58:19 -04:00
Artem Bilan
c655a8c4e2 Fix some locking issues in the KinesisMDChAdapter
Related to https://github.com/spring-projects/spring-integration-aws/issues/90
2018-06-25 21:42:24 -04:00
Artem Bilan
66e208f4f7 Try..catch updateTimeToLive in DynamoDbMetaDataSt
Related to https://github.com/spring-projects/spring-integration-aws/issues/90

The `dynamoDB.updateTimeToLive()` throws an exception if TTL is already
enabled on the table

* Wrap such a call to `try...catch()` and just log an error to let
the application to proceed
2018-06-25 21:29:11 -04:00
Artem Bilan
ebd562d6da GH-90: Add shard locking support to KinesisMDChA
Fixes https://github.com/spring-projects/spring-integration-aws/issues/90

* The `KinesisMessageDrivenChannelAdapter` can now be supplied with the
`LockRegistry` (e.g. `DynamoDbLockRegistry`) and when stream-based
configuration is used, the channel adapter performs `tryLock()` for the
shard in the channel adapter consumer group.
Therefor only one listener in the group is able to consume from the shard

Note: there is no yet full support for rebalance functionality.
And such a feature can be implemented using Spring Cloud Bus with the
command to stop and start channel adapters when a new
`KinesisMessageDrivenChannelAdapter` arrives to the cluster
2018-06-19 13:05:00 -04:00
Artem Bilan
fca661404a Upgrade to the latest SC-AWS and fix tests 2018-06-14 13:42:43 -04:00
Artem Bilan
5c262f1d3c GH-66: Add DynamoDbLockRegistry implementation (#93)
* GH-66: Add DynamoDbLockRegistry implementation

Fixes https://github.com/spring-projects/spring-integration-aws/issues/66

* * Remove `Lifecycle` from `DynamoDbLockRegistry` in favor of a thread
execution in the `afterPropertiesSet()`
* Fix `lock()` interruptibility logic

* * Remove `mavenLocal()` since the upstream PR is merged
* decrease an amount of expectations in the Kinesis test

* * Upgrade to SC-AWS-2.0.0.RC2

* * Add Docs for the `DynamoDbLockRegistry`
2018-06-08 16:49:23 -04:00
Artem Bilan
ffb4a6afe6 Fix JavaDocs for DynamoDbMetaDataStore
https://build.spring.io/browse/INTEXT-AWS-JOB1-148
2018-05-22 17:03:11 -04:00
Artem Bilan
598384bc8c Add TTL to DynamoDbMetaDataStore
Fixes https://github.com/spring-projects/spring-integration-aws/issues/92
2018-05-22 16:51:50 -04:00
Spring Buildmaster
50c1d6dcb7 [artifactory-release] Next development version 2018-04-16 18:10:39 +00:00
Spring Buildmaster
a011663ca7 [artifactory-release] Release version 2.0.0.M2 2018-04-16 18:10:33 +00:00
Artem Bilan
2c58a6925e Add records conversion support in batch mode
https://stackoverflow.com/questions/49730808/unable-to-consume-messages-as-batch-mode-in-kinesis-binder
2018-04-12 18:11:57 -04:00
Artem Bilan
6a999b2873 GH-51: Add headers mapping to channel adapters
Fixes spring-projects/spring-integration-aws#51
2018-04-06 16:51:47 -04:00
Artem Bilan
2b57f34801 Use ConcurrentMetadataStore for checkpointer
https://stackoverflow.com/questions/49315062/spring-cloud-aws-stream-messages-are-consumed-by-multiple-instances-in-consumer

There is a race condition when we check if the checkpoint exists or not
and then we perform `put` unconditionally

* Change the checkpointer logic to perform `replace()` if the entry
exists or `putIfAbsent()` if not.
In both cases check for the result to determine if the current
sequence number if the biggest and therefore we are good to process
record(s)
2018-03-19 15:51:20 -04:00
Artem Bilan
a50135c354 GH-85: Add SqsMDChannelAdapter.getQueue()
Fixes spring-projects/spring-integration-aws#85

* For better component management add
`SqsMessageDrivenChannelAdapter.getQueue()` to return what queues this
channel adapter is subscribed
* Upgrade to Gradle 4.6 and Checkstyle 8.8
2018-03-12 13:34:49 -04:00
Artem Bilan
54b7220459 GH-84: Kinesis Inbound: errors immunity
Fixes spring-projects/spring-integration-aws#84
Fixes spring-cloud/spring-cloud-stream-binder-aws-kinesis#38
Fixes spring-cloud/spring-cloud-stream-binder-aws-kinesis#36

Even if AWS Client has some reconnect and retry mechanism, it can be
exhausted and no connection error is rethrown to the `KinesisMessageDrivenChannelAdapter`
anyway.

On the other hand the error can be thrown from the record processor -
the flow on the `outputChannel`.

* log the exception around AWS Client calls and let background process
to restore/retry
* log the exception around message to send to let the processor to move
to the next record or perform the next task
* null the current `task` in the `ShardConsumer` in the `finally` block
to avoid hanging the thread without ability to moving to some other state
without end-user interaction
* When perform the `batch` checkpoint, check the result and if it is
negative, consider such a situation as processed and skip records from
sending downstream
* Upgrade dependencies
* Use Log4J2 for tests logging
2018-03-01 15:22:02 -05:00
Spring Buildmaster
c57f0ea2e9 [artifactory-release] Next development version 2018-02-12 19:54:13 +00:00
Spring Buildmaster
dcbe8e2826 [artifactory-release] Release version 2.0.0.M1 2018-02-12 19:54:08 +00:00
Artem Bilan
7769ba3494 Upgrade to SC-AWS-2.0.0.M3 2018-02-10 19:19:20 -05:00
Artem Bilan
8981384b26 Fix KinesisMessageHandler.sequenceNumber SpEL 2018-02-10 18:57:43 -05:00