我试图用日记持久性将Akka.Net配置为MongoDb,但它正在抛出一个我无法完全弄清楚的异常。是否有一个我可以查看的参考示例,以了解它应该如何工作?,我本来希望单元测试中的示例能够满足我的这一需求,但是持久性的MongoDb实现缺少测试。:(
下面是我遇到的错误:
Akka.Actor.ActorInitializationException : Exception during creation --->
System.TypeLoadException : Method 'ReplayMessagesAsync' in type
'Akka.Persistence.MongoDb.Journal.MongoDbJournal' from assembly
'Akka.Persistence.MongoDb, Version=1.0.5.2, Culture=neutral, PublicKeyToken=null'
does not have an implementation.这是我的这个应用程序的HOCON:--编辑--谢谢你的提示;基于此,我更新了这个HOCON和Sqlite,但是MongoDb的一个仍然是错误的。
<![CDATA[
akka {
actor {
provider = "Akka.Remote.RemoteActorRefProvider, Akka.Remote"
}
remote {
helios.tcp {
port = 9870 #bound to a specific port
hostname = localhost
}
}
persistence {
publish-plugin-commands = on
journal {
#plugin = "akka.persistence.journal.sqlite"
plugin = "akka.persistence.journal.mongodb"
mongodb {
class = "Akka.Persistence.MongoDb.Journal.MongoDbJournal, Akka.Persistence.MongoDb"
connection-string = "mongodb://localhost/Akka"
collection = "EventJournal"
}
sqlite {
class = "Akka.Persistence.Sqlite.Journal.SqliteJournal, Akka.Persistence.Sqlite"
plugin-dispatcher = "akka.actor.default-dispatcher"
connection-string = "FullUri=file:Sqlite-journal.db?cache=shared;"
connection-timeout = 30s
schema-name = dbo
table-name = event_journal
auto-initialize = on
timestamp-provider = "Akka.Persistence.Sql.Common.Journal.DefaultTimestampProvider, Akka.Persistence.Sql.Common"
}
}
snapshot-store {
#plugin = "akka.persistence.snapshot-store.sqlite"
plugin = "akka.persistence.snapshot-store.mongodb"
mongodb {
class = "Akka.Persistence.MongoDb.Snapshot.MongoDbSnapshotStore, Akka.Persistence.MongoDb"
connection-string = "mongodb://localhost/Akka"
collection = "SnapshotStore"
}
sqlite {
class = "Akka.Persistence.Sqlite.Snapshot.SqliteSnapshotStore, Akka.Persistence.Sqlite"
plugin-dispatcher = "akka.actor.default-dispatcher"
connection-string = "FullUri=file:Sqlite-journal.db?cache=shared;"
connection-timeout = 30s
schema-name = dbo
table-name = snapshot_store
auto-initialize = on
}
}
}
}
]]>
</hocon>所以,回到我最初的问题:是否有工作的MongoDb示例,我可以研究一下,以了解打算如何使用?
发布于 2016-04-15 21:01:29
配置要求为程序集提供完全限定的类型名称。尝试将类指定为"Akka.Persistence.MongoDb.Journal.MongoDbJournal, Akka.Persistence.MongoDb" (您可能也不需要双引号,因为它不是内联字符串)。
发布于 2022-07-29 18:17:17
一个旧的线程,但是下面是我几年前使用Akka.Persistence.MongoDb +集群构建的一个大型示例:https://github.com/Aaronontheweb/InMemoryCQRSReplication
https://stackoverflow.com/questions/36652359
复制相似问题