Skip to content

Commit 3cf2eee

Browse files
committed
Remove persistence default serializer feature
1 parent a0b5e8f commit 3cf2eee

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/QueryExecutor.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ public class QueryConfiguration
181181
/// <summary>
182182
/// The default serializer used when not type override matching is found
183183
/// </summary>
184-
public string DefaultSerializer { get; }
184+
[Obsolete(message: "This property will always return null")]
185+
public string DefaultSerializer => null;
185186

186187
/// <summary>
187188
/// Uses the CommandBehavior.SequentialAccess when creating the command, providing a performance improvement for reading large BLOBS.
@@ -220,7 +221,7 @@ public QueryConfiguration(
220221
string orderingColumnName,
221222
string serializerIdColumnName,
222223
TimeSpan timeout,
223-
string defaultSerializer,
224+
string defaultSerializer, // This is being ignored now
224225
bool useSequentialAccess)
225226
{
226227
SchemaName = schemaName;
@@ -235,7 +236,6 @@ public QueryConfiguration(
235236
Timeout = timeout;
236237
TagsColumnName = tagsColumnName;
237238
OrderingColumnName = orderingColumnName;
238-
DefaultSerializer = defaultSerializer;
239239
SerializerIdColumnName = serializerIdColumnName;
240240
UseSequentialAccess = useSequentialAccess;
241241
}
@@ -780,7 +780,7 @@ protected DbCommand GetCommand(DbConnection connection, string sql)
780780
protected virtual void WriteEvent(DbCommand command, IPersistentRepresentation e, IImmutableSet<string> tags)
781781
{
782782

783-
var serializer = Serialization.FindSerializerForType(e.Payload.GetType(), Configuration.DefaultSerializer);
783+
var serializer = Serialization.FindSerializerForType(e.Payload.GetType());
784784

785785
// TODO: hack. Replace when https://github.com/akkadotnet/akka.net/issues/3811
786786
var (binary,manifest) = Akka.Serialization.Serialization.WithTransport(Serialization.System,(e.Payload,serializer) ,(state) =>
@@ -846,7 +846,7 @@ protected virtual IPersistentRepresentation ReadEvent(DbDataReader reader)
846846
{
847847
// Support old writes that did not set the serializer id
848848
var type = Type.GetType(manifest, true);
849-
var deserializer = Serialization.FindSerializerForType(type, Configuration.DefaultSerializer);
849+
var deserializer = Serialization.FindSerializerForType(type);
850850
// TODO: hack. Replace when https://github.com/akkadotnet/akka.net/issues/3811
851851
deserialized = Akka.Serialization.Serialization.WithTransport(
852852
Serialization.System, (deserializer, (byte[])payload, type),

src/core/Akka.API.Tests/CoreAPISpec.ApprovePersistenceSqlCommon.verified.txt

+1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ namespace Akka.Persistence.Sql.Common.Journal
221221
public readonly System.TimeSpan Timeout;
222222
public readonly string TimestampColumnName;
223223
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) { }
224+
[System.ObsoleteAttribute("This property will always return null")]
224225
public string DefaultSerializer { get; }
225226
public string FullJournalTableName { get; }
226227
public string FullMetaTableName { get; }

src/core/Akka.Persistence/persistence.conf

-6
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ akka.persistence {
115115
# Dispatcher for message replay.
116116
replay-dispatcher = "akka.persistence.dispatchers.default-replay-dispatcher"
117117

118-
# Default serializer used as manifest serializer when applicable and payload serializer when no specific binding overrides are specified
119-
serializer = "json"
120-
121118
# Removed: used to be the Maximum size of a persistent message batch written to the journal.
122119
# Now this setting is without function, PersistentActor will write as many messages
123120
# as it has accumulated since the last write.
@@ -174,9 +171,6 @@ akka.persistence {
174171
# Dispatcher for the plugin actor.
175172
plugin-dispatcher = "akka.persistence.dispatchers.default-plugin-dispatcher"
176173

177-
# Default serializer used as manifest serializer when applicable and payload serializer when no specific binding overrides are specified
178-
serializer = "json"
179-
180174
circuit-breaker {
181175
max-failures = 5
182176
call-timeout = 20s

0 commit comments

Comments
 (0)