Skip to content

Commit

Permalink
Remove persistence default serializer feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkatufus committed Nov 2, 2022
1 parent a0b5e8f commit 3cf2eee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ public class QueryConfiguration
/// <summary>
/// The default serializer used when not type override matching is found
/// </summary>
public string DefaultSerializer { get; }
[Obsolete(message: "This property will always return null")]
public string DefaultSerializer => null;

/// <summary>
/// Uses the CommandBehavior.SequentialAccess when creating the command, providing a performance improvement for reading large BLOBS.
Expand Down Expand Up @@ -220,7 +221,7 @@ public QueryConfiguration(
string orderingColumnName,
string serializerIdColumnName,
TimeSpan timeout,
string defaultSerializer,
string defaultSerializer, // This is being ignored now
bool useSequentialAccess)
{
SchemaName = schemaName;
Expand All @@ -235,7 +236,6 @@ public QueryConfiguration(
Timeout = timeout;
TagsColumnName = tagsColumnName;
OrderingColumnName = orderingColumnName;
DefaultSerializer = defaultSerializer;
SerializerIdColumnName = serializerIdColumnName;
UseSequentialAccess = useSequentialAccess;
}
Expand Down Expand Up @@ -780,7 +780,7 @@ protected DbCommand GetCommand(DbConnection connection, string sql)
protected virtual void WriteEvent(DbCommand command, IPersistentRepresentation e, IImmutableSet<string> tags)
{

var serializer = Serialization.FindSerializerForType(e.Payload.GetType(), Configuration.DefaultSerializer);
var serializer = Serialization.FindSerializerForType(e.Payload.GetType());

// TODO: hack. Replace when https://github.com/akkadotnet/akka.net/issues/3811
var (binary,manifest) = Akka.Serialization.Serialization.WithTransport(Serialization.System,(e.Payload,serializer) ,(state) =>
Expand Down Expand Up @@ -846,7 +846,7 @@ protected virtual IPersistentRepresentation ReadEvent(DbDataReader reader)
{
// Support old writes that did not set the serializer id
var type = Type.GetType(manifest, true);
var deserializer = Serialization.FindSerializerForType(type, Configuration.DefaultSerializer);
var deserializer = Serialization.FindSerializerForType(type);
// TODO: hack. Replace when https://github.com/akkadotnet/akka.net/issues/3811
deserialized = Akka.Serialization.Serialization.WithTransport(
Serialization.System, (deserializer, (byte[])payload, type),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ namespace Akka.Persistence.Sql.Common.Journal
public readonly System.TimeSpan Timeout;
public readonly string TimestampColumnName;
public QueryConfiguration(string schemaName, string journalEventsTableName, string metaTableName, string persistenceIdColumnName, string sequenceNrColumnName, string payloadColumnName, string manifestColumnName, string timestampColumnName, string isDeletedColumnName, string tagsColumnName, string orderingColumnName, string serializerIdColumnName, System.TimeSpan timeout, string defaultSerializer, bool useSequentialAccess) { }
[System.ObsoleteAttribute("This property will always return null")]
public string DefaultSerializer { get; }
public string FullJournalTableName { get; }
public string FullMetaTableName { get; }
Expand Down
6 changes: 0 additions & 6 deletions src/core/Akka.Persistence/persistence.conf
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ akka.persistence {
# Dispatcher for message replay.
replay-dispatcher = "akka.persistence.dispatchers.default-replay-dispatcher"

# Default serializer used as manifest serializer when applicable and payload serializer when no specific binding overrides are specified
serializer = "json"

# Removed: used to be the Maximum size of a persistent message batch written to the journal.
# Now this setting is without function, PersistentActor will write as many messages
# as it has accumulated since the last write.
Expand Down Expand Up @@ -174,9 +171,6 @@ akka.persistence {
# Dispatcher for the plugin actor.
plugin-dispatcher = "akka.persistence.dispatchers.default-plugin-dispatcher"

# Default serializer used as manifest serializer when applicable and payload serializer when no specific binding overrides are specified
serializer = "json"

circuit-breaker {
max-failures = 5
call-timeout = 20s
Expand Down

0 comments on commit 3cf2eee

Please sign in to comment.