I am working on Akka.net persistence and using MongoDb as the persistent store. One of the properties on the events that we persist is of custom struct type "Rational". We have configured a custom serializer for this Rational type that serializes rational type value into a decimal value. However, we don't see that custom serializer getting invoked at all. The MongoDb shows newly inserted document with rational value of type object instead of decimal.
Below is akka.hocon configuration;
akka {
actor {
serializers {
my-rational = "RationalTypePersistence.RationalSerializer, RationalTypePersistence"
}
serialization-bindings {
"RationalTypePersistence.Rational, RationalTypePersistence" = "my-rational"
}
}
}
In debugging session also, the breakpoints set in the custom serializer's "ToBinary" and "fromBinary" methods don't get hit. The breakpoint in the constructor get hits multiple times though.
The custom serializer is extending Akka.Serialization.Serializer, and has overriden Identifier, FromBinary, ToBinary properties/methods.
Are we missing any configuration ?