spring-projects/spring-integration-aws

DynamoDbLock - Missing the key sortKey in the item

Closed this issue · 1 comments

Hello,

I am working with : spring-integration-aws:3.0.0.
Previously I used version 2.5.4.

When deploying the application on AWS, I get an error Missing the key sortKey in the item when the application checks for Locks.

When checking spring-integration-aws code I can see in files :

Those changes happened between 2.5.4 and 3.0.0, it seems that in the new version, the sortKey completly disappeared.

I find no documentation on this change and it makes the upgrade from 2.X.X to 3.X.X impossible.

Is there a way to add the sort key in version 3 ?
Or do I have to migrate the Lock DynamoDB table to a new one where the sort key doesn't exist ?

Thank you.

Yes. You have to migrate to a new table structure.
It is fully different from what was there before with DynamoDB Lock Client.

We have mentioned that breaking change in one of our release blog posts: https://spring.io/blog/2023/03/27/spring-integration-for-aws-3-0-0-m2-and-spring-cloud-stream-kinesis-binder-4

See also DynamoDbLockRepository JavaDocs if you manage those tables yourself:

 * The DynamoDb table must have these attributes:
 * <ul>
 * <li> {@link DynamoDbLockRepository#KEY_ATTR} {@link ScalarAttributeType#S} - partition key {@link KeyType#HASH}
 * <li> {@link DynamoDbLockRepository#OWNER_ATTR} {@link ScalarAttributeType#S}
 * <li> {@link DynamoDbLockRepository#CREATED_ATTR} {@link ScalarAttributeType#N}
 * <li> {@link DynamoDbLockRepository#TTL_ATTR} {@link ScalarAttributeType#N}
 * </ul>

So, lockKey S HASH , lockOwner S, createdAt N, expireAt N.
The last one can be configured as time-to-live attribute.

Closing this as nothing we can do to support the old, not fully working table.