Add the following to your sbt build (2.12.x, 2.13.x, 3.x.x):
The plugin uses the AWS SDK to access DynamoDB. The plugin has separate modules for each AWS SDK, so please decide on the version of the module you want to use. We recommend the module for AWS SDK v2.
- if you use event sourced
val version = "..."
val awsClientVersion = "v2" // or "v1"
libraryDependencies += Seq(
"com.github.j5ik2o" %% s"pekko-persistence-dynamodb-journal-$awsClientVersion" % version,
"com.github.j5ik2o" %% s"pekko-persistence-dynamodb-snapshot-$awsClientVersion" % version
)
:height: 250px
:name: tag-list
Choose from the tag list in the Github repository
The Journal and Snapshot plugins are independent and can be used separately. For example, you can use DynamoDB for Journal and another plugin for Snapshot. And vice versa.
- if you use durable state
val version = "..."
val awsClientVersion = "v2" // or "v1"
libraryDependencies += Seq(
"com.github.j5ik2o" %% s"pekko-persistence-dynamodb-state-$awsClientVersion" % version
)
Since version 1.7, the plugin have been split by AWS SDK version. There are no changes to the configuration file specifications. Currently used configuration files can be used as they are.
Create the table using the JSON file under tools
directory.
$ aws dynamodb create-table --cli-input-json file://./tools/journal-table.json
Please add the following settings to your application.conf
.
pekko.persistence.journal.plugin = "j5ik2o.dynamo-db-journal"
If you use the v1 module, the following configuration is required.
j5ik2o.dynamo-db-journal {
dynamo-db-client.client-version = "v1"
}
If you want to use DynamoDB Local, do the following
j5ik2o.dynamo-db-journal {
dynamo-db-client {
access-key-id = "x"
secret-access-key = "x"
endpoint = "http://localhost:8000/"
}
}
Do not use the above method in the production environment. Be sure to use IAM Role without specifying the above parameters.
Create the table using the JSON file under tools
directory.
$ aws dynamodb create-table --cli-input-json file://./tools/snapshot-table.json
The snapshot table format has changed since 1.9. If you want to use the old table format, set `j5ik2o.dynamo-db-snapshot.legacy-table-format` to true.
Please add the following settings to your application.conf
.
pekko.persistence.snapshot-store.plugin = "j5ik2o.dynamo-db-snapshot"
If you use the v1 module, the following configuration is required.
j5ik2o.dynamo-db-snapshot {
dynamo-db-client.client-version = "v1"
}
If you want to use DynamoDB Local, do the following
j5ik2o.dynamo-db-snapshot {
dynamo-db-client {
access-key-id = "x"
secret-access-key = "x"
endpoint = "http://localhost:8000/"
}
}
Do not use the above method in the production environment. Be sure to use IAM Role without specifying the above parameters.
Create the table using the JSON file under tools
directory.
$ aws dynamodb create-table --cli-input-json file://./tools/state-table.json
Please add the following settings to your application.conf
.
pekko.persistence.state.plugin = "j5ik2o.dynamo-db-state"
If you use the v1 module, the following configuration is required.
j5ik2o.dynamo-db-state {
dynamo-db-client.client-version = "v1"
}
If you want to use DynamoDB Local, do the following
j5ik2o.dynamo-db-state {
dynamo-db-client {
access-key-id = "x"
secret-access-key = "x"
endpoint = "http://localhost:8000/"
}
}
Do not use the above method in the production environment. Be sure to use IAM Role without specifying the above parameters.
See below for an example implementation of a persistent actor by using pekko typed. Note that pekko classic is not recommended.
Please also see the official documentation.
Please refer to the following for the setting items of each plugin.
Common configuration items are defined in reference.conf
of the base project.