You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Note**: 3.0.0-M2 is the last version compatible with Spring Boot 2.7.x and Spring Cloud 3.1. Starting from 3.0.0-M3, project has switched to Spring Boot 3.0.
Copy file name to clipboardExpand all lines: docs/src/main/asciidoc/_configprops.adoc
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@
32
32
|spring.cloud.aws.dynamodb.endpoint | | Overrides the default endpoint.
33
33
|spring.cloud.aws.dynamodb.region | | Overrides the default region.
34
34
|spring.cloud.aws.dynamodb.table-prefix | | The prefix used to resolve table names.
35
+
|spring.cloud.aws.dynamodb.table-separator | | The word separator used to resolve table names.
35
36
|spring.cloud.aws.dynamodb.table-suffix | | The suffix used to resolve table names.
36
37
|spring.cloud.aws.endpoint | | Overrides the default endpoint for all auto-configured AWS clients.
37
38
|spring.cloud.aws.fips-enabled | | Configure whether the SDK should use the AWS fips endpoints.
@@ -92,10 +93,12 @@
92
93
|spring.cloud.aws.sqs.dualstack-enabled | | Configure whether the AWS client should use the AWS dualstack endpoint. Note that not each AWS service supports dual-stack. For complete list check <ahref="https://docs.aws.amazon.com/vpc/latest/userguide/aws-ipv6-support.html">AWS services that support IPv6</a>
|spring.cloud.aws.sqs.endpoint | | Overrides the default endpoint.
96
+
|spring.cloud.aws.sqs.listener.auto-startup | | Configure whether SQS listeners are started automatically or not. If set to false, the listener containers need to be started manually.
95
97
|spring.cloud.aws.sqs.listener.max-concurrent-messages | | The maximum concurrent messages that can be processed simultaneously for each queue. Note that if acknowledgement batching is being used, the actual maximum number of messages inflight might be higher.
98
+
|spring.cloud.aws.sqs.listener.max-delay-between-polls | | The maximum amount of time to wait between consecutive polls to SQS.
96
99
|spring.cloud.aws.sqs.listener.max-messages-per-poll | | The maximum number of messages to be retrieved in a single poll to SQS.
97
100
|spring.cloud.aws.sqs.listener.poll-timeout | | The maximum amount of time for a poll to SQS.
Copy file name to clipboardExpand all lines: docs/src/main/asciidoc/dynamodb.adoc
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,11 @@ dynamoDbTemplate.save(person);
62
62
63
63
==== Resolving Table Name
64
64
65
-
To resolve a table name for an entity, `DynamoDbTemplate` uses a bean of type `DynamoDbTableNameResolver`. The default implementation turns an entity class name into its snake case representation with the possibility of using a table name prefix (optional) and suffix (optional). Specify the `spring.cloud.aws.dynamodb.table-prefix` and `spring.cloud.aws.dynamodb.table-suffix` to provide a table name prefix and suffix. The prefix is prepended to the table name and suffix is appended to the table name. For example, if `spring.cloud.aws.dynamodb.table-prefix` is configured as `foo_` and `spring.cloud.aws.dynamodb.table-suffix` is configured as `_foo2` and the entity class is `Person`, then the default implementation resolves the table name as `foo_person_foo2`. You can configure both properties, only one of them or none. However if you do not specify `spring.cloud.aws.dynamodb.table-prefix` and `spring.cloud.aws.dynamodb.table-suffix`, the table name will be resolved as `person`.
65
+
To resolve a table name for an entity, `DynamoDbTemplate` uses a bean of type `DynamoDbTableNameResolver`. The default implementation turns an entity class name into its snake case representation with the possibility of using a table name prefix (optional), suffix (optional), or overriding the separator (optional).
66
+
67
+
Specify the `spring.cloud.aws.dynamodb.table-prefix` and `spring.cloud.aws.dynamodb.table-suffix` to provide a table name prefix and suffix. The prefix is prepended to the table name and suffix is appended to the table name. For example, if `spring.cloud.aws.dynamodb.table-prefix` is configured as `foo_` and `spring.cloud.aws.dynamodb.table-suffix` is configured as `_foo2` and the entity class is `Person`, then the default implementation resolves the table name as `foo_person_foo2`. You can configure both properties, only one of them or none. However if you do not specify `spring.cloud.aws.dynamodb.table-prefix` and `spring.cloud.aws.dynamodb.table-suffix`, the table name will be resolved as `person`.
68
+
69
+
Specify the `spring.cloud.aws.dynamodb.table-separator` to override the `_` word separator. For example if `spring.cloud.aws.dynamodb.table-separator` is configured as `-` and the entity class is `MoreComplexPerson`, then the table name will be resolved as `more-complex-person`.
66
70
67
71
To use a custom implementation, declare a bean of type `DynamoDbTableNameResolver` and it will get injected into `DynamoDbTemplate` automatically during auto-configuration.
68
72
@@ -135,6 +139,7 @@ The Spring Boot Starter for DynamoDb provides the following configuration option
135
139
| `spring.cloud.aws.dynamodb.region` | Configures region used by `DynamoDbClient`. | No |
136
140
| `spring.cloud.aws.dynamodb.table-prefix` | Table name prefix used by the default `DynamoDbTableNameResolver` implementation. | No |
137
141
| `spring.cloud.aws.dynamodb.table-suffix` | Table name suffix used by the default `DynamoDbTableNameResolver` implementation. | No |
142
+
| `spring.cloud.aws.dynamodb.table-separator` | Table name word separator used by the default `DynamoDbTableNameResolver` implementation. | No | `_`
138
143
139
144
| `spring.cloud.aws.dynamodb.dax.idle-timeout-millis` |Timeout for idle connections with the DAX cluster. | No | `30000`
@@ -181,3 +186,32 @@ Note that `DynamoDbClientCustomizer` beans are applied **after** `AwsSyncClientC
181
186
182
187
Since it depends on how you will use DynamoDb integration providing a list of IAM policies would be pointless since least privilege model should be used.
183
188
To check what IAM policies DynamoDb uses and see which ones you should use please check https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/using-identity-based-policies.html[IAM policies]
189
+
190
+
[#spring-integration-support]
191
+
=== Spring Integration Support
192
+
193
+
Starting with version 4.0, Spring Cloud AWS provides https://spring.io/projects/spring-integration[Spring Integration] components for Amazon DynamoDB.
194
+
195
+
The `DynamoDbMetadataStore` is a https://docs.spring.io/spring-integration/reference/meta-data-store.html[`ConcurrentMetadataStore`] implementation to store and retrieve key-value entries in the specific DynamoDB.
196
+
It requires a `DynamoDbAsyncClient` and default table name is `SpringIntegrationMetadataStore`.
197
+
If the table is not present, the `DynamoDbMetadataStore` creates it on its initialization issuing an async `dynamoDB.createTable()` request.
198
+
The table structure is like:
199
+
200
+
- the `metadataKey` is a string table key as a hash;
201
+
- the `metadataValue` is a string for entry value;
202
+
- the `expireAt` is time-to-live attribute according to respective algorithm in DynamoDB.
203
+
204
+
See `DynamoDbMetadataStore` Javadocs for more information.
205
+
206
+
The `DynamoDbLockRegistry` is an `ExpirableLockRegistry` and `RenewableLockRegistry` implementation for the https://docs.spring.io/spring-integration/reference/distributed-locks.html[`DistributedLock`] abstraction based on DynamoDB table.
207
+
The supporting `DynamoDbLockRepository` class is for DynamoDB table management and low-level DynamoDB API interaction.
208
+
It requires a `DynamoDbAsyncClient`, and the default table name is `SpringIntegrationLockRegistry`.
209
+
210
+
The table structure is like:
211
+
212
+
- the `lockKey` is a string table key as a hash;
213
+
- the `lockOwner` is a string for lock record ownership — the instance which holds the lock at the moment;
214
+
- the `createdAt` is an `Instant.now().getEpochSecond()` when the lock record was created;
215
+
- the `expireAt` is time-to-live attribute according to respective algorithm in DynamoDB.
216
+
217
+
See `DynamoDbLockRegistry` and `DynamoDbLockRepository` Javadocs for more information.
0 commit comments