Hi,
I see that version 5.0.1. of Akka Persistence JDBC plugin is available and I have tried to use it in my Lagom project. I use Lagom 1.6.5.
I have tried this so far:
build.sbt:
val AkkaVersion = "2.6.10"
val SlickVersion = "3.3.3"
lazy val `myproj-impl` = (project in file("myproj-impl"))
...
.settings(
libraryDependencies ++= Seq(
...
"com.lightbend.akka" %% "akka-persistence-jdbc" % "5.0.1",
"com.typesafe.akka" %% "akka-persistence-query" % AkkaVersion,
"com.typesafe.slick" %% "slick" % SlickVersion,
"com.typesafe.slick" %% "slick-hikaricp" % SlickVersion
...
)
)
application.conf:
akka {
persistence {
journal {
plugin = "jdbc-journal"
// Enable the line below to automatically start the journal when the actorsystem is started
// auto-start-journals = ["jdbc-journal"]
}
snapshot-store {
plugin = "jdbc-snapshot-store"
// Enable the line below to automatically start the snapshot-store when the actorsystem is started
// auto-start-snapshot-stores = ["jdbc-snapshot-store"]
}
}
}
jdbc-journal {
slick = ${slick}
}
# the akka-persistence-snapshot-store in use
jdbc-snapshot-store {
slick = ${slick}
}
# the akka-persistence-query provider in use
jdbc-read-journal {
slick = ${slick}
}
slick {
profile = "slick.jdbc.PostgresProfile$"
db {
host = "localhost"
host = ${?DB_HOST}
url = "jdbc:postgresql://"${slick.db.host}":5432/mydb"
user = "someuser"
password = "somepassword"
driver = "org.postgresql.Driver"
numThreads = 5
maxConnections = 5
minConnections = 1
}
}
But this does not work.
An error message raised that db.default
still needs to be configured and I do not know why. The url, driver, user and password is then configured twice (once in db.default
and second in slick
).
Then another error raised:
java.lang.NoSuchMethodError: 'com.typesafe.config.Config akka.persistence.jdbc.util.ConfigOps$ConfigOperations$.asConfig$default$2$extension(com.typesafe.config.Config)'
It seems that an older version of typesafe.config.Config
is in the classpath.
Please, what is the proper way to configure use of Akka Persistence JDBC Plugin v 5.0.1?
Thank you very much for any hints.
Ales