petabridge / akkadotnet-cluster-workshop

Akka.NET + Kubernetes + Akka.Cluster Training Course
https://petabridge.com/cluster/
Apache License 2.0
99 stars 32 forks source link

MatchingEngine it is not recovered from a snapshot ? #130

Open pliolis opened 3 years ago

pliolis commented 3 years ago

https://github.com/petabridge/akkadotnet-cluster-workshop/blob/bb7df6bd42c0dea90ae8defbc68140358afa61f2/src/Akka.CQRS.Matching/MatchingEngine.cs#L66

Hi, are we losing asks and bids here?

Aaronontheweb commented 3 years ago

Yes, absolutely - had to disable that serialization when using standard MongoDB polymorphic representation. If I followed through with using the Protobuf serialization all the way through then that would not be an issue.

pliolis commented 3 years ago

Aaron, you mean something like TradeEventSerializer but for the MatchingEngine in conjunction with the appropriate configuration like https://getakka.net/articles/persistence/custom-serialization.html

Aaronontheweb commented 3 years ago

Yep! That's correct - we did that with some of the events here: https://github.com/petabridge/akkadotnet-cluster-workshop/blob/dev/src/Akka.CQRS/Serialization/TradeEventSerializer.cs

For the pricing engine, I actually defined all of the protos and compiled them here: https://github.com/petabridge/akkadotnet-cluster-workshop/tree/dev/src/Akka.CQRS.Pricing/Serialization/Proto

But I never got around to writing the full serializer - ran short on time before we had to present this live the very first time.