Commit Graph

294 Commits

Author SHA1 Message Date
Artem Bilan
8e2a00a652 Try some other way for image compatibility #2 2022-05-17 15:30:21 -04:00
Artem Bilan
0321167eae Try some other way for image compatibility 2022-05-17 14:50:19 -04:00
Artem Bilan
91b5a3633d Add asCompatibleSubstituteFor("localstack") 2022-05-17 14:46:10 -04:00
Artem Bilan
18aaaecea3 Use specific tag for Localstack Docker image
* Use `withReuse(true)` for better performance with Testcontainers
2022-05-17 14:37:34 -04:00
Artem Bilan
dfc25dd01d GH-205: Skip block in DynamoDbLockReg.tryLock()
Fixes https://github.com/spring-projects/spring-integration-aws/issues/205

The `AmazonDynamoDBLockClient.acquireLock()` steps into a busy-wait loop with a sleep timeout.

* Use `AcquireLockOptions.shouldSkipBlockingWait = true` for `tryLock()` without timeout
to have an immediate answer according `tryLock()` contract
* Reset flag to `false` for all other use-cases with `AcquireLockOptions`

**Cherry-pick to `2.5.x`**
2022-05-17 13:53:50 -04:00
Anton Barkan
f771f924b5 Cancel KinesisMDChA.shCMFuture after active=false
It's misleading to see an error for interrupted `KinesisMessageDrivenChannelAdapter.ShardConsumerManager`
on shutdown.

* Move `this.shardConsumerManagerFuture.cancel(true)` in the `doStop()` after `this.active = false;`
2022-04-28 11:04:23 -04:00
Artem Bilan
d818175db0 Fix @since in the LocalstackContainerTest 2022-04-01 10:02:40 -04:00
Artem Bilan
15ea0b181e Increase poll timeouts in tests
* Add `describeStream()` requests to Kinesis tests
to wait for `ACTIVE` before starting to interaction with the stream
2022-03-31 10:26:34 -04:00
Artem Bilan
62b54d1cdf Use unique Kinesis streams for different tests 2022-03-30 17:23:41 -04:00
Artem Bilan
a2f644a353 Use custom Docker registry for Testcontainers 2022-03-30 17:14:56 -04:00
Artem Bilan
6cd191fa8f Fix leftovers for Localstack API 2022-03-30 16:27:41 -04:00
Artem Bilan
620b741ba8 Start version 3.0
* Upgrade to Jakarta EE
* Upgrade to Spring Integration 6.0
* Use Testcontainers instead of direct Localstack
2022-03-30 16:19:40 -04:00
Artem Bilan
055307e7ba Downgrade Checkstyle to 9.3 for Java 8 2022-03-30 13:25:01 -04:00
Artem Bilan
96352a7580 Upgrade dependencies; fix compatibility 2022-03-30 13:16:04 -04:00
Spring Builds
8975c51c0a [artifactory-release] Next development version 2021-06-03 18:47:25 +00:00
Spring Builds
a02c1e89f7 [artifactory-release] Release version 2.5.1 2021-06-03 18:47:21 +00:00
Jonathan Nagayoshi
a002646f63 No NextShardIterator if not processed manual ack batch
* fix(KinesisMessageDrivenChannelAdapter): added logic to not use the NextShardIterator if Manual Checkpointer hasnt reached the last checkpoint

* fix(KinesisMessageDrivenChannel): added logs for getNextShardIterator

* fix(KinesisMessageDrivenChannelAdapter): fixed logic and comments issue

* feat(KinesisMessageDrivenChannelAdapter): implemented integration tests for getNextShardIterator new usecase

* feat(KinesisMessageDrivenChannelAdapter): updated @author

* feat(KinesisMessageDrivenChannelAdapterTests): added author data
2021-05-25 13:52:53 -04:00
Spring Builds
f10d6c6620 [artifactory-release] Next development version 2021-05-20 15:37:21 +00:00
Spring Builds
16c8bd1d8f [artifactory-release] Release version 2.5.0 2021-05-20 15:37:18 +00:00
Artem Bilan
fa4f5d7903 Upgrade dependencies; fix compatibility; release 2021-05-20 11:18:29 -04:00
Edgar Herrero Uría
537e6f6861 GH-193: Migrate to new Spring Cloud AWS group
Fixes https://github.com/spring-projects/spring-integration-aws/issues/193

Starting with version `2.3` Spring Cloud AWS has been moved
to new Maven coordinates.

* Change `org.springframework.cloud` for SC-AWS to new `io.awspring.cloud`
* Fix imports for new package
* Fix links, coordinates and pacakges in docs
2021-04-12 12:45:11 -04:00
Artem Bilan
57ccd1fb5b Start version 2.5
* Upgrade some dependencies; fix compatibilities
2021-04-09 14:57:20 -04:00
Artem Bilan
3a7222f456 Get rid off "master" word in the project 2021-04-07 12:20:44 -04:00
Artem Bilan
881720deaf GH-188: expose KplMessageHandler.flushDuration
Fixes https://github.com/spring-projects/spring-integration-aws/issues/188
Fixes https://github.com/spring-cloud/spring-cloud-stream-binder-aws-kinesis/issues/154

Also fix `KinesisMessageDrivenChannelAdapter` to not ERROR unlock interrupt
when the `KinesisMessageDrivenChannelAdapter` is not active any more

**Cherry-pick to `2.3.x`**
2021-03-22 16:37:40 -04:00
Spring Buildmaster
7638c5a192 [artifactory-release] Next development version 2021-01-27 21:52:14 +00:00
Spring Buildmaster
c233d65cfd [artifactory-release] Release version 2.4.0 2021-01-27 21:52:10 +00:00
Artem Bilan
1cf84957a8 Fix XSD version; language in the README 2021-01-27 16:45:26 -05:00
Spring Buildmaster
60840decab [artifactory-release] Next development version 2021-01-27 21:15:12 +00:00
Spring Buildmaster
4a817352c4 [artifactory-release] Release version 2.4.0 2021-01-27 21:15:08 +00:00
Artem Bilan
ac08caf1c8 Upgrade dependencies; Gradle
* Fix compatibility with latest dependencies
* Prepare for release
2021-01-27 14:57:28 -05:00
Artem Bilan
d529b7171e Start version 2.4 2021-01-27 13:39:43 -05:00
Spring Buildmaster
b1017a8990 [artifactory-release] Next development version 2021-01-27 18:15:11 +00:00
Spring Buildmaster
48859a4ef9 [artifactory-release] Release version 2.3.5.RELEASE 2021-01-27 18:15:07 +00:00
Artem Bilan
501a334541 Upgrade dependencies; prepare for release 2021-01-27 12:54:36 -05:00
Artem Bilan
9a434b833a S3MessageHandler: Don't close stream after MD5
Related to https://stackoverflow.com/questions/65892759/for-an-upload-inputstream-with-no-md5-digest-metadata-the-marksupported-meth

The `Md5Utils.md5AsBase64(inputStream)` closes an `InputStream` in the end,
but we still need this `InputStream` as an original data for the remote file to store

* Change `S3MessageHandler` logic to use a `DigestUtils.md5Digest(inputStream)` instead
which doesn't close `InputStream` in the end
2021-01-27 11:41:51 -05:00
Artem Bilan
ea135917f3 Add lockRenewalTimeout to the KinesisMesChAd
Related to https://github.com/spring-cloud/spring-cloud-stream-binder-aws-kinesis/issues/148
2021-01-13 15:31:06 -05:00
acm19
b43a230ffe GH-190: Swallow checkpoint provisioning exception
Resolves https://github.com/spring-projects/spring-integration-aws/issues/190

Swallows `ProvisionedThroughputExceededException` while checkpointing
exhausted shards to avoid the `ShardConsumer` from not being marked as
closed and therefore be left in an inconsistent state which will only
throw exceptions as the `shardIterator` would be `null` and the
`ShardConsumer` wouldn't be marked as `CLOSED`.
2021-01-12 10:01:46 -05:00
Artem Bilan
696472037f Handle only LockNotGrantedException for heartbeat
If we don't have a connection to AWS or our thread is interrupted
for some reason, we should just re-throw that exception as is.

* Only catch a `LockNotGrantedException` which really indicates
that the state of the lock record has been changed.
Therefore we also have to reset local state and try again
2021-01-07 10:34:49 -05:00
Artem Bilan
6b0933c7b7 Reset DynamoDb lockItem when HeartBeat fails
Related to https://github.com/spring-cloud/spring-cloud-stream-binder-aws-kinesis/issues/148

If a `DynamoDbLock` has been locked before,
it contains a `lockItem` indicating that we can send a heart-beat
the next tine when we would like to re-lock again instead of calling
regular lock and fail because the lock record exists already.
On the other hand the heart-beat can fail by itself for many reasons
including the case when record in DB was removed somehow.

* Change the `DynamoDbLock.doLock()` logic to catch `sendHeartBeat()`
exception and reset local state to let it to try to lock again with
the regular `tryAcquireLock()` API
2021-01-06 17:15:10 -05:00
Artem Bilan
526353c9d8 Kinesis CA: Fulfill lockFuture on exception
Related to https://github.com/spring-cloud/spring-cloud-stream-binder-aws-kinesis/issues/148

When `lock.tryLock()` ends up with an exception,
we just log it under error category.

* Add also `lockFuture.complete(false)` in the catch block
when we try to renew the lock
2020-12-21 13:24:52 -05:00
Artem Bilan
ac74dfd236 Add lock renewal for KinesisChannelAdapter
Related to https://github.com/spring-cloud/spring-cloud-stream-binder-aws-kinesis/issues/148

The current implementation has a flaw when it uses a distributed lock
for an exclusive access to shard for consuming only once at start up.
Such a behavior cause the problem when we have a network glitch at
runtime, so the lock is broken, but consumer is still active to retry
consumption attempts

* Add `renewLockIfAny()` logic ot the `ShardConsumer`, so we ensure
that we are still a lock holder and don't consume otherwise
* Add `unlockFuture` logic to block the `ShardConsumer.stop()`
until we really got lock unlocked.
Otherwise we end up with the race condition when we are still
stopping, but already ready to start a new consumer for the same
shard
2020-12-18 16:00:50 -05:00
jkatnik
c15e345470 GH-187 INFO for error when KinesisChA is inactive
Fixes https://github.com/spring-projects/spring-integration-aws/issues/187
2020-12-18 10:15:54 -05:00
Artem Bilan
eed4a624f3 Fix Checkstyle violation 2020-12-14 13:59:21 -05:00
Artem Bilan
6e0687fdfa Disable Kinesis tests against Localstack 2020-12-14 13:51:38 -05:00
Artem Bilan
79d565d7bc Increase Kinesis tests timeouts 2020-12-14 13:41:27 -05:00
Artem Bilan
1da944ece8 Use Localstack 0.2.25
* Upgrade some other dependencies including Gradle
* Fix compatibility with the latest Localstack
2020-12-14 12:41:55 -05:00
acm19
f8ca0e4056 GH-183: Expose BillingMode option
Resolves: https://github.com/spring-projects/spring-integration-aws/issues/183

Exposes `BillingMode` option on the `DynamoDbMetadataStore` and
`DynamoDbLockRegistry`. 
Moves the `LockRegistry` table creation to inside
this project as the DynamoDB Lock client doesn't support pay per request
model and that library seems abandoned.
2020-12-11 12:01:00 -05:00
Refal
c99698dfb6 GH-184: Correct default values in KclMDChAdapter
Fixes https://github.com/spring-projects/spring-integration-aws/issues/184

During creating `KclMessageDrivenChannelAdapter`
if `config == null` a default `KinesisClientLibConfiguration` is created 
with parameter `leaseCleanupIntervalMillis == 0` which causes an `IllegalArgumentExcpetoin` 
when KPL is initialized

* Use default reasonable values for lease clean up intervals.
* Copy respective constants from the `KinesisClientLibConfiguration` into the `KclMessageDrivenChannelAdapter`
since they are `private` over there
2020-12-01 10:05:42 -05:00
Spring Buildmaster
a0d0752cdc [artifactory-release] Next development version 2020-10-29 15:53:44 +00:00
Spring Buildmaster
705b56a7a9 [artifactory-release] Release version 2.3.4.RELEASE 2020-10-29 15:53:40 +00:00