These are chat archives for akkadotnet/akka.net

7th
Aug 2017
Carlos Torrecillas
@CarlosTorrecillas
Aug 07 2017 11:31
hi guys, is there any "obvious" reason why an actor could terminate a method (or finishes a message processing) when invoking an await Method(); ? I trying to figure that out but so far I had no luck. I call an I/O operation inside a Receive<RequestMessage> and I can't see any log line or anything going on, really weird. It just start processing the next message in the mailbox
I have used both Receive Async and PipeTo and both print when the message starts to be processed but nothing else
`private void Subscribed()
{
Logger.Debug($"{Self.Path.Name} node is ready");
        Receive<RequestMessage>(e => ProcessRequest(e));

        Receive<ResponseMessage>(p => SendResponseBack(p));
    }

    private void ProcessRequest(RequestMessage requestMessage)
    {
        Logger.Debug($"{Self.Path.Name} started request processing");

        _aDependency.ProcessAsync(requestMessage.Data)
                              .ContinueWith(e => new ResponseMessage(e.Result), TaskContinuationOptions.AttachedToParent & TaskContinuationOptions.ExecuteSynchronously)
                              .PipeTo(Self, Context.Sender);
    }

    private void SendResponseBack(ResponseMessage response)
    {
        Context.Sender.Tell(response, Self);

        Logger.Debug($"{Self.Path.Name} finished request processing");
    }`
Carlos Torrecillas
@CarlosTorrecillas
Aug 07 2017 11:38
that's the code and I'm not entirely sure what am I doing wrong. The Subscribed method gets invoked when the node joins the cluster and I can see that happening. Then the started processing log line is also printed. But immediately after the next message starts. The operation should take 2 seconds so I should expect to see the "finished" at some point but I see nothing. Also there is nothing related to the logging printed by the dependency inside the method which makes me think that the ProcessAsync simply doesn't start
Carlos Torrecillas
@CarlosTorrecillas
Aug 07 2017 11:45
found that out. THe actual message content (Data) was null. It's all good now
you can ignore all of the above
Janusz Fijałkowski
@JohnnyTheAwesome
Aug 07 2017 11:50
Figured out the problem I've had earlier. It seems Hyperion can't deserialize the Exception type. It actually made me realize I don't need to send the entire object just the error message and stack trace. Yay for lighter payloads.
Alex Valuyskiy
@alexvaluyskiy
Aug 07 2017 12:28
@JohnnyTheAwesome Hyperion has limited support for serializing/deserializing exceptions. But the exceptions should have a default public parameterless constructor
And it does not support custom fields/properties inside exceptions
Janusz Fijałkowski
@JohnnyTheAwesome
Aug 07 2017 14:04
@alexvaluyskiy Exception does indeed have a public parameterless constructor. However it's TargetSite field is of MethodBase type, which in turn has a protected constructor. Guess this might be it, however I didn't dig further once I've realized that jamming the entire Exception object in a message sent over the network isn't really something that I want to do.
Carlos Torrecillas
@CarlosTorrecillas
Aug 07 2017 14:14
Do you guys know of any issue when getting asking for the currentTopics? Once I have a publisher joining a cluster I need to send two messages to check that a specific topic is available to publish. I have added a retry mechanism but that doesn't help. I actually need to send two messages to that actor to make this to work
Carlos Torrecillas
@CarlosTorrecillas
Aug 07 2017 14:38
by setting the retries to be half a second it works - fyi
Robert Stiff
@uatec
Aug 07 2017 21:03
hi there
i'm working with Cluster Sharding
I have the example working, but in my project, it is not distributing the work on to my other worker node
hmm, do I have to create a cluster sharding region on each worker?
hmm, i did that, now the work that was being done on my command node has moved to my worker node... and it's stopped executing on my command node