Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ organization := "com.sclasen"

name := "akka-persistence-dynamodb"

version := "0.3.4-SNAPSHOT"
version := "0.3.5-SNAPSHOT"

scalaVersion := "2.11.1"
scalaVersion := "2.11.2"

crossScalaVersions := Seq("2.11.1", "2.10.4")
crossScalaVersions := Seq("2.11.2", "2.10.4")

parallelExecution in Test := false

//resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

resolvers += "spray repo" at "http://repo.spray.io"

libraryDependencies += "com.sclasen" %% "spray-dynamodb" % "0.3.2" % "compile"
libraryDependencies += "com.sclasen" %% "spray-dynamodb" % "0.3.6-SNAPSHOT" % "compile"

libraryDependencies += "com.typesafe.akka" %% "akka-persistence-experimental" % "2.3.4" % "compile"
libraryDependencies += "com.typesafe.akka" %% "akka-persistence-experimental" % "2.3.5" % "compile"

libraryDependencies += "com.typesafe.akka" %% "akka-testkit" % "2.3.4" % "test,it"
libraryDependencies += "com.typesafe.akka" %% "akka-testkit" % "2.3.5" % "test,it"

libraryDependencies += "org.scalatest" %% "scalatest" % "2.1.7" % "test,it"
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.1" % "test,it"

libraryDependencies += "commons-io" % "commons-io" % "2.4" % "test,it"

Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.1")

resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.2")
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0")


Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import akka.persistence.journal.AsyncWriteJournal
import akka.serialization.SerializationExtension
import akka.util.ByteString
import com.amazonaws.AmazonServiceException
import com.amazonaws.auth.{BasicAWSCredentials, InstanceProfileCredentialsProvider, AWSCredentialsProvider}
import com.amazonaws.internal.StaticCredentialsProvider
import com.amazonaws.services.dynamodbv2.model._
import com.sclasen.spray.aws.dynamodb.DynamoDBClient
import com.sclasen.spray.aws.dynamodb.DynamoDBClientProps
Expand Down Expand Up @@ -164,10 +166,18 @@ object DynamoDBJournal {
val schema = Seq(new KeySchemaElement().withKeyType(KeyType.HASH).withAttributeName(Key)).asJava
val schemaAttributes = Seq(new AttributeDefinition().withAttributeName(Key).withAttributeType("S")).asJava

def provider(system: ActorSystem, config: Config): AWSCredentialsProvider = {
if (!config.hasPath(AwsKey) || config.getString(AwsKey).isEmpty) {
system.log.info("Using InstanceProfileCredentialsProvider")
new InstanceProfileCredentialsProvider
}
else
new StaticCredentialsProvider(new BasicAWSCredentials(config.getString(AwsKey), config.getString(AwsSecret)))
}

def dynamoClient(system: ActorSystem, context: ActorRefFactory, config: Config): DynamoDBClient = {
val props = DynamoDBClientProps(
config.getString(AwsKey),
config.getString(AwsSecret),
provider(system, config),
config.getDuration(OpTimeout, TimeUnit.MILLISECONDS) milliseconds,
system,
context,
Expand Down