作为持久性:JDBC MySQL 的工作示例不足

Akka Persistence: No Sufficient Working Example for JDBC MySQL

我一直试图让我的 EventSourceBehavior 写入 MySQL,但出现以下错误,可能是什么问题?错误非常普遍,很难看出根本原因是什么。有没有办法测试我的 JDBC 是否通过 Akka、ex 连接等正确配置,谢谢

2020-11-20 00:48:57,999 WAR HikariConfig              slick.db - using dataSourceClassName and ignoring jdbcUrl.
2020-11-20 00:48:57,999 WAR HikariConfig              slick.db - using dataSourceClassName and ignoring jdbcUrl.
2020-11-20 00:48:58,002 INF HikariDataSource          slick.db - Starting...
2020-11-20 00:48:58,002 INF HikariDataSource          slick.db - Starting...
2020-11-20 00:48:58,041 INF HikariDataSource          slick.db - Start completed.
2020-11-20 00:48:58,042 INF HikariDataSource          slick.db - Start completed.
2020-11-20 00:49:18,293 ERR Main$                     Supervisor StopSupervisor saw failure: Exception during recovery from snapshot. PersistenceId [first]. Circuit Breaker Timed out.
akka.persistence.typed.internal.JournalFailureException: Exception during recovery from snapshot. PersistenceId [first]. Circuit Breaker Timed out.

application.conf

akka {
  loglevel = DEBUG

  persistence {
    journal.plugin = "jdbc-journal"
    snapshot-store.plugin = "jdbc-snapshot-store"
  }
}

slick {
  profile = "slick.jdbc.MySQLProfile$"
  db {
    dataSourceClass = "slick.jdbc.DriverDataSource"
    driver = "com.mysql.cj.jdbc.Driver"
    url = "jdbc:mysql://localhost:3306/"
    user = nilu
    password = "password"
  }
}

一般来说,使用 Akka Persistence JDBC,您需要指定要使用的数据库,而不仅仅是要连接的 DBMS(服务器)。因此,如果数据库被称为 my_akka_persistence,则 JDBC URL 将类似于 jdbc:mysql://localhost:3306/my_akka_persistence.