diff --git a/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/QueryExecutor.cs b/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/QueryExecutor.cs index e2f41e41d16..8a6ab9ff18a 100644 --- a/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/QueryExecutor.cs +++ b/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/QueryExecutor.cs @@ -691,19 +691,22 @@ protected virtual void WriteEvent(DbCommand command, IPersistentRepresentation e var serializer = Serialization.FindSerializerForType(payloadType, Configuration.DefaultSerializer); // TODO: hack. Replace when https://github.com/akkadotnet/akka.net/issues/3811 - string manifest = ""; + string manifest = e.Manifest; var binary = Akka.Serialization.Serialization.WithTransport(Serialization.System, () => { - - if (serializer is SerializerWithStringManifest stringManifest) - { - manifest = stringManifest.Manifest(e.Payload); - } - else + + if (string.IsNullOrEmpty(manifest)) { - if (serializer.IncludeManifest) + if (serializer is SerializerWithStringManifest stringManifest) { - manifest = e.Payload.GetType().TypeQualifiedName(); + manifest = stringManifest.Manifest(e.Payload); + } + else + { + if (serializer.IncludeManifest) + { + manifest = e.Payload.GetType().TypeQualifiedName(); + } } } diff --git a/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/Serialization/SqliteJournalSerializationSpec.cs b/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/Serialization/SqliteJournalSerializationSpec.cs index d8003c344da..483aa54a2b2 100644 --- a/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/Serialization/SqliteJournalSerializationSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/Serialization/SqliteJournalSerializationSpec.cs @@ -46,10 +46,5 @@ class = ""Akka.Persistence.Sqlite.Journal.SqliteJournal, Akka.Persistence.Sqlite } }"); } - - [Fact(Skip = "Sql plugin does not support EventAdapter.Manifest")] - public override void Journal_should_serialize_Persistent_with_EventAdapter_manifest() - { - } } }