Я пытаюсь обновить существующий (демонстрационный) проект с Akka.Net 1.0.8 на что-то более новое (1.3.2 или что-то еще).
Я застрял на загрузке сохраняемости SQL-сервера. Я предпринял следующие шаги:
- Создал пустой проект и включил пакет Akka.Persistence.SqlServer и все его зависимости.
- Copied the HOCON configuration example from here:
- Changed the DB connection strings to an existing DB
- Установите автоинициализацию на «вкл.»
- Исправлена проблема с двойными кавычками в akka.persistence.journal-store.sql-server.plugin-dispatcher.
- Создал акторную систему
- Проверил конфигурацию SQL-сервера на наличие моей строки подключения
Полученные результаты:
- 1.3.2: строка подключения отсутствует (похоже на резервную конфигурацию по умолчанию), в БД ничего не происходит
- 1.0.8: строка подключения присутствует, конфиг вроде правильный, таблицы создаются в пустой БД.
Вот конфигурация HOCON, которую я использовал:
akka.persistence{
journal {
plugin = "akka.persistence.journal.sql-server"
sql-server {
# qualified type name of the SQL Server persistence journal actor
class = "Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.SqlServer"
# dispatcher used to drive journal actor
plugin-dispatcher = "akka.actor.default-dispatcher"
# connection string used for database access
connection-string = "Data Source=(LocalDB)\\MSSQLLocalDB;Initial Catalog=AkkaPersistence;Integrated Security=True"
# default SQL commands timeout
connection-timeout = 30s
# SQL server schema name to table corresponding with persistent journal
schema-name = dbo
# SQL server table corresponding with persistent journal
table-name = EventJournal
# should corresponding journal table be initialized automatically
auto-initialize = on
# timestamp provider used for generation of journal entries timestamps
timestamp-provider = "Akka.Persistence.Sql.Common.Journal.DefaultTimestampProvider, Akka.Persistence.Sql.Common"
# metadata table
metadata-table-name = Metadata
}
}
snapshot-store {
plugin = "akka.persistence.snapshot-store.sql-server"
sql-server {
# qualified type name of the SQL Server persistence journal actor
class = "Akka.Persistence.SqlServer.Snapshot.SqlServerSnapshotStore, Akka.Persistence.SqlServer"
# dispatcher used to drive journal actor
plugin-dispatcher = "akka.actor.default-dispatcher"
# connection string used for database access
connection-string = "Data Source=(LocalDB)\\MSSQLLocalDB;Initial Catalog=AkkaPersistence;Integrated Security=True"
# default SQL commands timeout
connection-timeout = 30s
# SQL server schema name to table corresponding with persistent journal
schema-name = dbo
# SQL server table corresponding with persistent journal
table-name = SnapshotStore
# should corresponding journal table be initialized automatically
auto-initialize = on
}
}
}
Есть ли способ устранить неполадки при загрузке конфигурации HOCON?