forked from akka/akka-persistence-dynamodb-1.x
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrading dynamodb journal plugin to Akka 2.4
This project had a dependency on spray-aws, which had a dependency on akka 2.3 and spray. Spray is no longer supported moving forward, so I changed the dependency to only require the aws sdk. There are some substantial changes in Akka 2.4 for persistence, most notably: - WriteConfirmations go away, so there is no more concept of imperanent deletes. A lot of code around write confirmations was removed from the plugin - The asyncWriteMessages signature changed. Instead of taking a Seq[PersistentRepr], it instead takes a Seq[AtomicWrite]. There are also certain guarantees around the handling of AtomicWrites that must be implemented; namely that every AtomicWrite has an associated Try[Unit] that is returned. This means that every AtomicWrite should yield a successful result. I had to change the way we handled asyncWriteMessages to always ensure a response. I beleive that this plugin will be backward compatible, as I did not alter the way the items are being built. I created an `integration-test.sh` that will run the tests. One of the tests was pulled from Martin Krasser's journal plugin; the other test uses the JournalSpec. I did not due the JournalPerfSpec as I am only running locally, and I was not able to get the throughput hitting the amazondb local.
- Loading branch information
1 parent
f1a634f
commit 2944e07
Showing
14 changed files
with
600 additions
and
402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
echo "Compiling..." | ||
sbt clean compile | ||
|
||
DB_DIR="target/db" | ||
PID_FILE="target/dynamo.pid" | ||
|
||
if [ ! -f dynamodb-local/DynamoDBLocal.jar ]; then | ||
./bin/get-dynamodb-local | ||
fi | ||
|
||
echo "Initializing db directory ${DB_DIR}" | ||
mkdir ${DB_DIR} | ||
|
||
echo "Starting up dynamod, pid is ${PID_FILE}" | ||
rm -f ${PID_FILE} | ||
|
||
nohup java -Djava.library.path=./dynamodb-local -jar ./dynamodb-local/DynamoDBLocal.jar -dbPath ${DB_DIR} > target/test-output.log 2>&1 & | ||
echo $! > ${PID_FILE} | ||
|
||
echo "Running load test" | ||
sbt it:test | ||
|
||
echo "Stopping dynamo" | ||
kill -9 `cat ${PID_FILE}` | ||
|
||
|
||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
dynamodb-journal { | ||
journal-table = ${JOURNAL_TABLE} | ||
aws-access-key-id = ${AWS_ACCESS_KEY_ID} | ||
aws-secret-access-key = ${AWS_SECRET_ACCESS_KEY} | ||
journal-table = "journal" | ||
aws-access-key-id = "perfTest" | ||
aws-secret-access-key = "notNeededForLocal" | ||
operation-timeout = 30 seconds | ||
sequence-shards = 10000 | ||
|
||
# asserts running dynamodb local | ||
endpoint = "http://localhost:8000" | ||
} | ||
|
||
akka.persistence.journal.plugin = "dynamodb-journal" | ||
akka.persistence.publish-confirmations = on | ||
akka.persistence.publish-plugin-commands = on | ||
akka.loglevel = ${LOG_LEVEL} | ||
|
||
akka.loglevel = "INFO" | ||
|
||
akka.event-handlers = ["akka.event.Logging$DefaultLogger"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.