1

我正在尝试使用 Mongodb 实现 Akka Persistence,但我收到一条错误消息

"Method 'DeleteAsync' in type 
'Akka.Persistence.MongoDb.Snapshot.MongoDbSnapshotStore' from assembly 
'Akka.Persistence.MongoDb, Version=1.0.4.1, Culture=neutral, 
PublicKeyToken=null' does not have an implementation"

这是我的配置:

var config = ConfigurationFactory.ParseString(@"
    akka {
        persistence {
        publish-plugin-commands = on
        snapshot-store {
            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""
            }
        }
        journal {
            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

并且正在向 Persistent Actor 发送消息,并且我不断收到以下消息

[ERROR][1/2/2016 2:36:36 AM][Thread 0011][akka://example123/user/section-actor] Method 'DeleteAsync' in type 'Akka.Persistence.MongoDb.Snapshot.MongoDbSnapshotStore' from assembly 'Akka.Persistence.MongoDb, Version=1.0.4.1, Culture=neutral, PublicKeyToken=null' does not have an implementation.
Cause: System.TypeLoadException: Method 'DeleteAsync' in type 'Akka.Persistence.MongoDb.Snapshot.MongoDbSnapshotStore' from assembly 'Akka.Persistence.MongoDb, Version=1.0.4.1, Culture=neutral, PublicKeyToken=null' does not have an implementation.
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.<SnapshotStoreFor>b__0() at System.Lazy1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
at 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)
at Akka.Persistence.Eventsourced.b__76_0(Receive receive, Object message)
at Akka.Persistence.Eventsourced.AroundReceive(Receive receive, Object message)
at Akka.Actor.ActorCell.ReceiveMessage(Object message)
at Akka.Actor.ActorCell.Invoke(Envelope envelope)
4

1 回答 1

5

根据 Akka.NET Persistence on MongoDB 的开发人员的更新,随着 1.0.5 的引入,这在 mongo 中的持久性中被打破了。它将很快得到纠正。

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

于 2016-01-03T07:05:25.963 回答