-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persisence serializer setting #2933
Changes from 11 commits
ff7dbff
ef19d00
dc4517b
c3e241a
c17d4f9
387f564
7ba3b1d
b9df564
ca22a79
9045816
ef5780c
d71bf77
99a5565
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,11 @@ public class SnapshotStoreSettings | |
/// </summary> | ||
public bool AutoInitialize { get; private set; } | ||
|
||
/// <summary> | ||
/// The default serializer being used if no type match override is specified | ||
/// </summary> | ||
public string DefaultSerializer { get; private set; } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="SnapshotStoreSettings"/> class. | ||
/// </summary> | ||
|
@@ -130,6 +135,7 @@ public SnapshotStoreSettings(Config config) | |
SchemaName = config.GetString("schema-name"); | ||
TableName = config.GetString("table-name"); | ||
AutoInitialize = config.GetBoolean("auto-initialize"); | ||
DefaultSerializer = config.GetString("serializer"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even if this setting is not specified by the plugin explicitly, it should still be available. See changes in persistence.conf |
||
} | ||
|
||
/// <summary> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
using Akka.Actor; | ||
using Akka.Configuration; | ||
using Akka.TestKit; | ||
using FluentAssertions; | ||
using Xunit; | ||
|
||
namespace Akka.Persistence.Tests.Serialization | ||
|
@@ -22,12 +23,12 @@ internal class Configs | |
akka.actor { | ||
serializers { | ||
my-payload = ""Akka.Persistence.Tests.Serialization.MyPayloadSerializer, Akka.Persistence.Tests"" | ||
my-payload2 = ""Akka.Persistence.Tests.Serialization.MyPayload2Serializer, Akka.Persistence.Tests"" | ||
old-payload = ""Akka.Persistence.Tests.Serialization.OldPayloadSerializer, Akka.Persistence.Tests"" | ||
testserializer = ""Akka.Serialization.HyperionSerializer, Akka.Serialization.Hyperion"" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In order to fix these tests. I switched system default serializer for these tests to Hyperion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In fact. After talking this over with @alexvaluyskiy we are not sure why we have this Spec at all. It was disabled before. But it does not test any real-world scenario as far as we know. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. None that I can think of |
||
} | ||
serialization-bindings { | ||
""Akka.Persistence.Tests.Serialization.MyPayload, Akka.Persistence.Tests"" = my-payload | ||
""Akka.Persistence.Tests.Serialization.MyPayload2, Akka.Persistence.Tests"" = my-payload2 | ||
""System.Object"" = testserializer | ||
# this entry was used when creating the data for the test | ||
# ""deserialize data when class is removed"" | ||
#""Akka.Persistence.Tests.Serialization.OldPayload, Akka.Persistence.Tests"" = old-payload | ||
|
@@ -94,7 +95,7 @@ public override int GetHashCode() | |
} | ||
|
||
// TODO: temporary disabled | ||
public abstract class MessageSerializerRemotingSpec : AkkaSpec | ||
public class MessageSerializerRemotingSpec : AkkaSpec | ||
{ | ||
internal class LocalActor : ActorBase | ||
{ | ||
|
@@ -186,7 +187,7 @@ public void MessageSerializer_should_custom_serialize_Persistent_messages_during | |
// this also verifies serialization of Persistent.Sender, | ||
// because the RemoteActor will reply to the Persistent.Sender | ||
_localActor.Tell(new Persistent(new MyPayload("a"), sender: TestActor)); | ||
ExpectMsg("p.a."); | ||
ExpectMsg("pa"); | ||
} | ||
|
||
[Fact] | ||
|
@@ -195,8 +196,10 @@ public void MessageSerializer_should_custom_serialize_AtomicWrite_messages_durin | |
var p1 = new Persistent(new MyPayload("a"), sender: TestActor); | ||
var p2 = new Persistent(new MyPayload("b"), sender: TestActor); | ||
_localActor.Tell(new AtomicWrite(ImmutableList.Create(new IPersistentRepresentation[] {p1, p2}))); | ||
ExpectMsg("p.a."); | ||
ExpectMsg("p.b."); | ||
Within(5.Seconds(), () => { | ||
ExpectMsg("pa"); | ||
ExpectMsg("pb"); | ||
}); | ||
} | ||
|
||
[Fact] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me