Hi, I am currently trying Lagom 1.6.4 Akka Typed Persistence and JDBC write side and I was surprised to see in the journal in the message field this event representation:
I was expecting only pure event JSON representation (as it was when I used Lagom 1.5.4 with Lagom Persistence (classic) and Cassandra write side): {"idAccount":"2","name":"test2"}.
Everything works fine, but I wonder if the event serialization works correctly (maybe I have some misconfiguration here). What do you think?
what you’ve observed is a known issue in Akka Persistence JDBC. The problem is the serialized object is an internal class of Akka Persistence JDBC (a PersistentRepr) which contains the JSON payload instead of serializing the plain JSON payload.
Starting Akka Persistence JDBC 5.0.0 (to be released soon, use 5.0.0-RC1 in the meantime) this should be fixed.
Hi @ignasi35,
now 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.
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).