Skip to content

Commit 5994162

Browse files
committed
docs: Update README and Changelog
1 parent 392382e commit 5994162

File tree

3 files changed

+38
-24
lines changed

3 files changed

+38
-24
lines changed

CHANGELOG.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,18 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7-
## [Unreleased]
7+
# v2
8+
9+
## [Unreleased]
10+
### Changed
11+
- check TTL for stored items, as items that have expired may still appear
12+
13+
## [2.0.0] - 2022-08-17
14+
### Changed
15+
- use AWS Java SDK v2.x [@derXear](https://github.com/derXear)
16+
- update Spring Boot dependencies [@derXear](https://github.com/derXear)
17+
18+
# v1
819

920
## [0.9.6] - 2020-11-13
1021
### Changed
@@ -36,11 +47,12 @@ instead at least `DynamoDB::DescribeTable` is necessary [@derXear](https://githu
3647
### Added
3748
- initial code base by [@derXear](https://github.com/derXear)
3849

39-
[Unreleased]: https://github.com/bad-opensource/spring-cache-dynamodb/compare/v0.9.6...HEAD
40-
[0.9.6]: https://github.com/bad-opensource/spring-cache-dynamodb/releases/tag/v0.9.5...v0.9.6
41-
[0.9.5]: https://github.com/bad-opensource/spring-cache-dynamodb/releases/tag/v0.9.4...v0.9.5
42-
[0.9.4]: https://github.com/bad-opensource/spring-cache-dynamodb/releases/tag/v0.9.3...v0.9.4
43-
[0.9.3]: https://github.com/bad-opensource/spring-cache-dynamodb/releases/tag/v0.9.2...v0.9.3
44-
[0.9.2]: https://github.com/bad-opensource/spring-cache-dynamodb/releases/tag/v0.9.1...v0.9.2
45-
[0.9.1]: https://github.com/bad-opensource/spring-cache-dynamodb/releases/tag/v0.9.0...v0.9.1
46-
[0.9.0]: https://github.com/bad-opensource/spring-cache-dynamodb/releases/tag/v0.9.0
50+
[Unreleased]: https://github.com/bad-opensource/spring-cache-dynamodb/compare/v2.0.0...HEAD
51+
[2.0.0]: https://github.com/bad-opensource/spring-cache-dynamodb/releases/tag/v2.0.0
52+
[0.9.6]: https://github.com/bad-opensource/spring-cache-dynamodb/releases/tag/v0.9.6
53+
[0.9.5]: https://github.com/bad-opensource/spring-cache-dynamodb/releases/tag/v0.9.5
54+
[0.9.4]: https://github.com/bad-opensource/spring-cache-dynamodb/releases/tag/v0.9.4
55+
[0.9.3]: https://github.com/bad-opensource/spring-cache-dynamodb/releases/tag/v0.9.3
56+
[0.9.2]: https://github.com/bad-opensource/spring-cache-dynamodb/releases/tag/v0.9.2
57+
[0.9.1]: https://github.com/bad-opensource/spring-cache-dynamodb/releases/tag/v0.9.1
58+
[0.9.0]: https://github.com/bad-opensource/spring-cache-dynamodb/releases/tag/v0.9.0

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ To integrate this Git repository into your project, simply add the maven depende
1414
<dependency>
1515
<groupId>com.dasburo</groupId>
1616
<artifactId>spring-cache-dynamodb</artifactId>
17-
<version>0.9.6</version>
17+
<version>2.0.0</version>
1818
</dependency>
1919
```
20+
This release is using the AWS Java SDK v2.x. If you must use v1.x, please use a version prior to 2.0.0 of this library.
2021

2122
## Usage
2223

2324
### Quick start
2425

25-
There is an autoconfiguration class that will setup a simple key-value cache for you, provided you have specified the following properties.
26+
There is an autoconfiguration class that will set up a simple key-value cache for you, provided you have specified the following properties.
2627

2728
#### Properties
2829

@@ -58,28 +59,29 @@ To customize the creation of a cache manager, create a Java Bean in a [configura
5859
5960
```java
6061
@Bean
61-
public AWSCredentials amazonAWSCredentials() {
62-
return new BasicAWSCredentials(amazonAWSAccessKey, amazonAWSSecretKey);
62+
public AwsCredentials awsCredentials() {
63+
return AwsBasicCredentials.create(amazonAWSAccessKey, amazonAWSSecretKey);
6364
}
6465

6566
@Bean
66-
public AWSCredentialsProvider amazonAWSCredentialsProvider(AWSCredentials amazonAWSCredentials) {
67-
return new AWSStaticCredentialsProvider(amazonAWSCredentials);
67+
public AwsCredentialsProvider awsCredentialsProvider(AwsCredentials awsCredentials) {
68+
return StaticCredentialsProvider.create(awsCredentials);
6869
}
6970

7071
@Bean
71-
public AmazonDynamoDB amazonDynamoDB(AWSCredentialsProvider amazonAWSCredentialsProvider) {
72-
return AmazonDynamoDBClientBuilder.standard()
73-
.withCredentials(amazonAWSCredentialsProvider)
74-
.withRegion(Regions.EU_CENTRAL_1).build();
72+
public DynamoDbClient amazonDynamoDB(AwsCredentialsProvider awsCredentialsProvider) {
73+
return DynamoDbClient.builder()
74+
.credentialsProvider(awsCredentialsProvider)
75+
.region(Region.of(amazonAWSRegion))
76+
.build();
7577
}
7678

7779
@Bean
78-
public CacheManager cacheManager(AmazonDynamoDB amazonDynamoDB) {
80+
public CacheManager cacheManager(DynamoDbClient ddb) {
7981
List<DynamoCacheBuilder> cacheBuilders = new ArrayList<>();
80-
cacheBuilders.add(DynamoCacheBuilder.newInstance("myCache", amazonDynamoDB)
81-
.withTTL(Duration.ofSeconds(600)));
82-
82+
cacheBuilders.add(DynamoCacheBuilder.newInstance(cacheName, ddb)
83+
.withTTL(Duration.ofSeconds(cacheTtl)));
84+
8385
return new DynamoCacheManager(cacheBuilders);
8486
}
8587
```

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<groupId>com.dasburo</groupId>
1313
<artifactId>spring-cache-dynamodb</artifactId>
14-
<version>0.9.6</version>
14+
<version>2.0.0</version>
1515

1616
<name>Amazon DynamoDB for Spring Cache</name>
1717
<description>Spring Cache implementation based on Amazon DynamoDB</description>

0 commit comments

Comments
 (0)