-
Notifications
You must be signed in to change notification settings - Fork 6
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
Serialization payload #6
Comments
@Zetanova underneat the Reminder is just an actor. Like any actor it communicates by sending messages. If any recipient actor is supposed to receive the message from reminder, the details of serialization/deserialization must be known to both sides (just like when two actors talk with each other). If you want to send serializer-agnostic message, you can serialize/deserialize it explicitly like: var message = new MyMessage();
var payload = system.Serialization.FindSerializerFor(message).ToBytes(message, typeof(MyMessage));
var task = new Reminder.Schedule(taskId, recipient.Path, payload, delay);
reminder.Tell(task);
// then in the recipient actor
class Recipient : ReceiveActor
{
public Recipient()
{
var serializer = Context.System.Serialization.FindSerializerForType(typeof(MyMessage));
Receive<byte[]>(raw =>{
var messager = (MyMessage)serializer.FromBytes(raw);
});
}
} |
I thought about some kind of surrogate type defined by akka.net |
In theory you could do some kind of wrapper message, that's internally uses |
It looks like a generic problem that should be resolved over the akka.net base libery I will investigate more. |
I have made now one payload message type. This could then be used for sender defined remote success/failure messages Example of auto unwarp/dual-pass in ActorBase:
Payload class
|
@Zetanova I think, that the right place to include feature like that would be either in core akka projects or directly as serializer feature. |
@Horusiath Yes, i thinking of the same, posted it know into the akkadotnet/akka.net#3811 |
If there are multiple nodes with different roles and assemblies in the cluster.
Currently Reminder can only accept a payload where the type is known to every node.
Else reminder could not receive and/or deserialize the payload message.
But for the functionality of the reminder service it is not important to deserialize it.
Only the receiving node should be able to deserialize the payload back.
The text was updated successfully, but these errors were encountered: