MongoDB的Akka.Net持久性

时间:2016-01-02 02:49:13

标签: akka.net

我正在尝试使用Mongodb实现Akka Persistence,并且我收到一个错误,在程序集'Akka.Persistence.MongoDb,Version ='Akka.Persistence.MongoDb.Snapshot.MongoDbSnapshotStore'中显示“方法'DeleteAsync' 1.0.4.1,Culture = neutral,PublicKeyToken = null'没有实现“

这是我的配置:

var config = ConfigurationFactory.ParseString(@“ akka { 持久性{ publish-plugin-commands = on 快照存储{ plugin =“”akka.persistence.snapshot-store.mongodb“” mongodb { class =“”Akka.Persistence.MongoDb.Snapshot.MongoDbSnapshotStore,Akka.Persistence.MongoDb“” connection-string =“”mongodb:// user:pass@paulo.mongohq.com:10083 / DbName“” collection =“”AkkaSnapshotStore“” } } 期刊{ plugin =“”akka.persistence.journal.mongodb“” mongodb { class =“”Akka.Persistence.MongoDb.Journal.MongoDbJournal,Akka.Persistence.MongoDb“” connection-string =“”mongodb:// user:pass@paulo.mongohq.com:10083 / DbName“” collection =“”AkkaEventJournal“” } } } }“);

我想我已经正确地创建了一个演员系统:

https://gist.github.com/amarwadi/a887b26e14b0d42191b7

我正在向持久性演员发送消息,并且我一直无限地收到以下消息

[错误] [1/2/2016 2:36:36 AM] [线程0011] [akka:// example123 / user / section-actor]类型'Akka.Persistence.MongoDb.Snapshot中的方法'DeleteAsync' .MongoDbSnapshotStore'来自程序集'Akka.Persistence.MongoDb,Version = 1.0.4.1,Culture = neutral,PublicKeyToken = null'没有实现。 原因:System.TypeLoadException:方法'Akka.Persistence.MongoDb.Snapshot.MongoDbSnapshotStore'中的方法'DeleteAsync'来自程序集'Akka.Persistence.MongoDb,Version = 1.0.4.1,Culture = neutral,PublicKeyToken = null'没有实现。 at System.RuntimeTypeHandle.GetTypeByName(String name,Boolean throwOnError,Boolean ignoreCase,Boolean reflectionOnly,StackCrawlMarkHandle stackMark,IntPtr pPrivHostBinder,Boolean loadTypeFromPartialName,ObjectHandleOnStack type) at System.RuntimeTypeHandle.GetTypeByName(String name,Boolean throwOnError,Boolean ignoreCase,Boolean reflectionOnly,StackCrawlMark& stackMark,IntPtr pPrivHostBinder,Boolean loadTypeFromPartialName) at System.RuntimeType.GetType(String typeName,Boolean throwOnError,Boolean ignoreCase,Boolean reflectionOnly,StackCrawlMark& stackMark) at System.Type.GetType(String typeName,Boolean throwOnError) at Akka.Persistence.PersistenceExtension.CreatePlugin(String configPath,Func2 dispatcherSelector)at Akka.Persistence.PersistenceExtension。<> c__DisplayClass13_0.b__0()at System.Lazy1.CreateValue() ---从抛出异常的先前位置开始的堆栈跟踪结束--- 在System.Lazy`1.get_Value() at Akka.Persistence.PersistenceExtension.SnapshotStoreFor(String snapshotPluginId) at Akka.Persistence.Eventsourced.get_SnapshotStore() at Akka.Persistence.Eventsourced.LoadSnapshot(String persistenceId,SnapshotSelectionCriteria criteria,Int64 toSequenceNr) 在Akka.Persistence.Eventsourced.b__76_0(接收接收,对象消息) 在Akka.Persistence.Eventsourced.AroundReceive(接收接收,对象消息) 在Akka.Actor.ActorCell.ReceiveMessage(对象消息) 在Akka.Actor.ActorCell.Invoke(信封信封)

1 个答案:

答案 0 :(得分:5)

根据MongoDB上Akka.NET Persistence的开发人员的更新,mongo的持久性在1.0.5的引入中被破坏了。它很快就会得到纠正。

https://github.com/akkadotnet/Akka.Persistence.MongoDB/issues/12