Akka.Hosting icon indicating copy to clipboard operation
Akka.Hosting copied to clipboard

`WithCustomSerializer` needs to add ability to specify serialization identifier

Open Aaronontheweb opened this issue 2 years ago • 1 comments

Version Information Version of Akka.NET? 1.0.1 Which Akka.NET Modules? Akka.Hosting

Describe the bug

One thing that Akka.Hosting can't currently do is specify the akka.actor.serialization-identifiers section of HOCON:

akka.actor{
   # This is to get the manifest back in the event journal
            serializers {
              json2 = "JsonSerializerWithManifest, MyInfrastructure"
            }

            serialization-bindings {
              "System.Object" = json2
            }

            serialization-identifiers {
              "JsonSerializerWithManifest, MyInfrastructure" = 410
            }
}

With the current WithCustomerSerializer method we can't specify this - instead we have to rely on the serializer hard-coding it by overriding the Serializer.Identifer property

.WithCustomSerializer("json2", new[]{ typeof(object) }, system => new JsonSerializerWithManifest(system))

Aaronontheweb avatar Jan 26 '23 01:01 Aaronontheweb

Hmm, this is going to require an Akka.NET update (to SerializerDetails) or a HOCON work-around...

Aaronontheweb avatar Jan 31 '23 22:01 Aaronontheweb