Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 00:10
    Arkatufus commented #231
  • Dec 02 16:49
    Aaronontheweb commented #5326
  • Dec 02 16:49
    Aaronontheweb closed #5326
  • Dec 02 16:47
    Aaronontheweb commented #5411
  • Dec 02 16:45
    Aaronontheweb labeled #5411
  • Dec 02 16:45
    Aaronontheweb labeled #5411
  • Dec 02 16:45
    Aaronontheweb opened #5411
  • Dec 02 16:24
    Aaronontheweb synchronize #5403
  • Dec 02 16:23
    Aaronontheweb closed #5407
  • Dec 02 16:23
    Aaronontheweb commented #5407
  • Dec 02 16:23

    Aaronontheweb on dev

    Fix UDP memory leak (#5404) * … (compare)

  • Dec 02 16:23
    Aaronontheweb closed #5404
  • Dec 02 16:23
    Aaronontheweb closed #5325
  • Dec 02 16:23
    Aaronontheweb auto_merge_disabled #5404
  • Dec 02 16:00
    Aaronontheweb commented #5365
  • Dec 02 14:46
    Aaronontheweb auto_merge_enabled #5404
  • Dec 02 14:46
    Arkatufus commented #5318
  • Dec 02 14:41
    Arkatufus synchronize #5404
  • Dec 02 14:40
    Arkatufus synchronize #5404
  • Dec 02 14:38
    Arkatufus auto_merge_disabled #5404
kariem-ali
@kariem-ali
Thanks
Chris G. Stevens
@cgstevens
@Aaronontheweb I just want to give a big thanks to whom ever did the Akka.Cluster.Tools!
Trying to monitor my cluster I had to be part of the cluster... and now I can get the cluster state and do commands to manage it without having to be part of the cluster.
My problem is when connecting to our Dev environment my tool or other nodes would freak out due to network packets dropping and just things start to become unreachable.
So moving the monitor to a website solved that issue except when my websites are unavailable... then what??
Once I have my internal tool working I will port it over to the Akka.Cluster.Monitor on github for anyone else to take advantage.
Ralf
@Ralf1108
is it possible to get an identity message from all running actors in a system? maybe via ActorSelection -> like:
'var messageId = Guid.NewGuid();
_topActors.System.ActorSelection("user/*").Tell(new Identify(messageId));
but how to collect the responses? there is only the "ResolveOne()" method. I also discovered the "Inbox" class but couldn't figure out to combine both
Ralf
@Ralf1108
I think i can use the inbox as the sender of the identity message...so all responses will be collected in the inbox
Andreas Dirnberger
@Zetanova
@Ralf1108 yes create an inbox and use it as the sender, it will receive all responses.
but i dont know it the "user/*" + identity is a good practice
Ralf
@Ralf1108
it is only for debuggging.. so i can look into a productive system when its running as last resort
Chris G. Stevens
@cgstevens
I was able to update my app to be able to get the cluster state and have the ability to force a member to leave the cluster without being part of it now. Very nice.
Bart de Boer
@boekabart
I've encountered the following a number of times now: fact that a message can't be (de)serialized when using remoting. Now I'm trying to add unit tests that verify that each 'message' class (every class in certain namespaces in my project) can be pulled through JsonConvert.
The problem however is whenever I use real ActorRefs here, I get an exception about a loop: property Provider that's self-referencing.
any idea's how to test this, then?
Bartosz Sypytkowski
@Horusiath
@boekabart if you want to test serialization, do that using true akka serializer. You can use actorSystem.Serialization.FindSerializerFor(message) to get the serializer for choosen type
Bart de Boer
@boekabart
Let me try that.
should I be able to use that serializer to go back and forth for 1 message instance?
Bart de Boer
@boekabart
Yep, that works like a charm!
Is it known and/or by design that Exceptions don't serialize?
(they did through jsonconvert & back, but losing their specific type. through 'serializer' they don't pass at all)
Steven Harrap
@stevenharrap

Hi
Just getting deeper into Akka.net here and I want to use a router with ConsistentHashing but I'm missing a key step. This my understanding:

  1. Create several actors
  2. Create some message types that implement the IConsistentHashable.
  3. Ensure the actors will accept that message types
  4. Create a mapping scheme that tells the router which message should go to which actor <-- this bit????
  5. Create the router with the list of actors and the mapping
  6. Celebrate!

`
public class MyMessage : IConsistentHashable
{
public readonly string P1;

/* some other properties *

public MyMessage (string p1) 
{
    this.P1 = p1;
}

public object ConsistentHashKey
{
    get
    {
        return this.P1;
    }
}

}

public class ActorSystemSetup
{
public ActorSystemSetup() {

    /* make some actors for the router here */

    var actors = new string[] {/* list of actors */};
    var mapping = new ConsistentHashMapping(/* something here that associates MyMessage.P1 with one of the actors */);
    var props = Props.Empty.WithRouter(new ConsistentHashingGroup(actors).WithHashMapping(mapping));
    actorSystem.ActorOf(props, "router-name");
}

}
`

So I'm possibly one line away from awesome. Can someone help me out?

And i got the formatting wrong
Bartosz Sypytkowski
@Horusiath
@boekabart have you created protected constrcutor with serialization info? It's one of the native Exception constructors, you should expose in your custom one
Bartosz Sypytkowski
@Horusiath
@stevenharrap this is not how the consistent hash router works - imagine that your consistent hash can operate on some range of hashes. What CH router does, is taking group of actors, it has been given, and splits them to serve part of that hash range, so i.e. given 5 actors and possible range of all hashes 1-100, actor1 will receive all messages with hash from 1-20, actor2: messages with hash 21-40 etc.
Steven Harrap
@stevenharrap
Ok. Not quite how I interpreted the documentation. Do you know of a router approach that would give the result I'm after?
Bartosz Sypytkowski
@Horusiath
This can be defined by yourself. You can create an actor and define messageId-actor mapping inside of it. It's quite straightforward
Optionally I guess you may want to checkout Akka.Cluster.Sharding. It's often something that people mistake with, when they are trying to use consistent hash router.
Steven Harrap
@stevenharrap
Ok. I was attracted to the asynchronous approach that the router takes in moving messages to destinations rather than the "one-at-a-time" approach that an actor mailbox will use.
Bartosz Sypytkowski
@Horusiath
last time I've checked out, single actor was able to receive 3.5mln messages/sec. adding a map to it should be a heavy slowdown
Steven Harrap
@stevenharrap
Ok - thanks Bartosz. Sounds like the router approach is overkill.
Andreas Dirnberger
@Zetanova
If a routie has some sort of interaction with other actors in the process, it would mean that the routie need to stack new incoming messages from the router. Can the routie somehow get in a bussy state?
Because if the routie is stacking up new command messages, the router most likly dont see the mailbox size anymore
Bartosz Sypytkowski
@Horusiath
@Zetanova you could use stashing + round robin instead of smallest mailbox router?
Andreas Dirnberger
@Zetanova
I am currently using only create-child, send command + process, send response, stop
I would need something for the query-actors, if the load goes up they need to throutle quit a bit
Bart de Boer
@boekabart
@Horusiath I haven't [created protected constructor], but do I understand correctly that akka [default serializer] can only serialize 'custom' exceptions that I've explicitly decorated to be serializable? (and if yes, will Wire fix this?)
Bartosz Sypytkowski
@Horusiath
you could probably create demand driven pub/sub, so each subscriber must inform publisher/router that it's ready to receive the message (personally I've never used routers in production app)
@boekabart .NET have its own way of serializing exceptions based on protected constructor an ISerializable interface. All serializers wanting to serialize/deserialize exception, must work with that.
Andreas Dirnberger
@Zetanova
@Horusiath Then i will not use them :)
Bart de Boer
@boekabart
What I notice, is that my poco with a long and an exception will serialize fine if exception==null, but not if it's populated with eg. new Exception("boomcrash")
Andreas Dirnberger
@Zetanova
@boekabart yes, just create them, or map the exception to an ErrorInfo type, that is fully seriazlizable, I needed to do this for WCF and angularJS
Bart de Boer
@boekabart
That's what I was planning, indeed. just investigating all my use cases now to see what kind of info I need 'on the other side'
Thanks again for the help
Andreas Dirnberger
@Zetanova
@boekabart internaly are exception the best, but the going outside of the AppDomain it gets near allways problematic. Then it is better to map them.
Ralf
@Ralf1108
public static class ActorSystemExtensions
{
public static IEnumerable<object> QueryAllUserActors(this ActorSystem system, object message)
{
using (var inbox = Inbox.Create(system))
{
system.ActorSelection("user/*").Tell(message, inbox.Receiver);
            while (true)
            {
                object response;

                try
                {
                    response = inbox.Receive(TimeSpan.FromSeconds(1));
                }
                catch (TimeoutException)
                {
                    break;
                }

                yield return response;
            }
        }
    }
}
ups...
just for reference.. yesterday I tried to query all user actors. With help from here I got this and it works nice
`public static class ActorSystemExtensions
{
public static IEnumerable<object> QueryAllUserActors(this ActorSystem system, object message)
{
using (var inbox = Inbox.Create(system))
{
system.ActorSelection("user/*").Tell(message, inbox.Receiver);
            while (true)
            {
                object response;

                try
                {
                    response = inbox.Receive(TimeSpan.FromSeconds(1));
                }
                catch (TimeoutException)
                {
                    break;
                }

                yield return response;
            }
        }
    }
}`
cant get the code to be properly formatted
`public static class ActorSystemExtensions
{
public static IEnumerable<object> QueryAllUserActors(this ActorSystem system, object message)
{
using (var inbox = Inbox.Create(system))
{
system.ActorSelection("user/*").Tell(message, inbox.Receiver);
            while (true)
            {
                object response;

                try
                {
                    response = inbox.Receive(TimeSpan.FromSeconds(1));
                }
                catch (TimeoutException)
                {
                    break;
                }

                yield return response;
            }
        }
    }
}`
Ralf
@Ralf1108
I think yesterday I found a way to mark messages to not influence the RecieveTimeout of an actor